Search API

Deprecated. The Search API has been deprecated. You should probably look into using the Content API instead, which offers similar functionality but with OAuth2 support.

GET /api/search

Search the TT database. Returns an array of TTNinjs objects that match the search criteria.

Name Description Default value
ak Application key
q Free text search string
p Comma-separared list of product codes. Filter search result by products.
agr Comma-separated list of agreement IDs. Filter search result by agreements.
trs Start date (YYYY-MM-dd)
tre End date (YYYY-MM-dd)
tr Time range: h (last hour), d (last day), w (last week) or y (last year)
s Size of search result 20
fr Index into search result 0
sort Sort by asc (ascending) or desc (descending) created date, stor (stored date), or rel (relevance) desc
Example:

Free text search for "lorem ipsum" in the "TTINR" product

GET https://app.tt.se/api/search?q=lorem+ipsum&p=TTINR&ak=<apiKey>

Free text search for "lorem ipsum" in the "FOTO" product:

GET https://app.tt.se/api/search?q=lorem+ipsum&p=FOTO&ak=<apiKey>

GET /api/search/agreements

Name Description Default value
ak Application key

Returns a JSON object where each key is the ID of a current customer agreement, and each value a list of products included in that agreement.

{
  "8588": [
    {
      "id": 8588,
      "name": "Foto TT Inrikes",
      "description": null,
      "productCode": "FOINRTT"
    },
    {
      "id": 8588,
      "name": "Foto TT Ekonomi",
      "description": null,
      "productCode": "FOEKOTT"
    }
  ],
  "40142": [
    {
      "id": 40142,
      "name": "Feature Bostad",
      "description": null,
      "productCode": "FTBOS0"
    }
  ]
}
Example:
GET https://app.tt.se/api/search/agreements?ak=<apiKey>

Authentication

The Search API uses Application Key authentication.