site logo

Tettra Help Docs

API Endpoint: Search

The Search endpoint returns up to 5 page results for the given search term.


URL: https://app.tettra.co/api/teams/{{team_id}}/search 


HTTP Method: GET


Arguments:  

  • api_key - required - your API key 
  • query - optional - the search term; returns most recent pages if omitted

Example Request:

curl -X GET \
   -H 'Content-Type: application/json' \
   --data \
   '{
       "api_key":"xxxxxxxxxxxxxxxxxx1234567890",
       "query":"Company Holidays"
   }' \
   https://app.tettra.co/api/teams/5/search


Example Response:

{ 
  success: true,
  query: "Company Holidays",
  pages: [
     {
        id: 2,
        title: "2020 Company Holidays",
        updated_at: "2020-06-03T17:10:24.000000Z",
        url: "https://app.tettra.co/teams/example/pages/2020-company-holidays",
        content: "{"blocks":[{"key":"avkfq","text":"example content","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}}],"entityMap":{}}",
        owner: "Andy",
        category: {
           id: 1,
           name: "Office & Ops",
           url: "https://app.tettra.co/teams/example/categories/1"
        }
     }
  ]
}


Related