api-reference

REST

Last updated Invalid Date

Tipe offers a REST API for getting your content into your app. If you're used to REST, you can use code you already know and understand to access your content.

You need 3 keys 🗝 to make a REST request:

  1. YOUR_ORG_SECRET_KEY
  2. YOUR_API_KEY
  3. The relevant DOCUMENT_ID

Make an API call

Our REST API is simple and easy to use. You can make a GET request for any Document or Folder.

https://api.tipe.io/api/v1/document

https://api.tipe.io/api/v1/folder

https://api.tipe.io/api/v1/folder/FOLDER_ID

https://api.tipe.io/api/v1/document/DOCUMENT_ID

Replace YOUR_ORG_SECRET_KEY and YOUR_API_KEY with the ones in the API Keys section of the Tipe dashboard.

See Finding your Document ID in the Documents article if you need help finding it.

You can also make a GET request for a template with the Template API ID and youʻll get all the Documents that use that template.

api.tipe.io/api/v1/template/:templateApiId

Headers

When you make REST calls, you must include a header like the following:

javascript
Content-Type: application/json
Authorization: YOUR_API_KEY
Tipe-Id: YOUR_ORG_SECRET_KEY

Curl

You can also make REST calls with curl. You'll format them like this:

shell
 curl 'https://api.tipe.io/api/v1/folder' \
  -H 'content-type: application/json' \
  -H 'authorization: YOUR_API_KEY' \
  -H 'tipe-id: YOUR_ORG_SECRET_KEY'

Using window.fetch()

You can make REST calls using the window.fetch() API to make requests for Document, Templates, and Folders.

Use window.fetch() with two arguments; the URL and options, fetch(url, options). The fetch() method will then return a promise with a response object that contains metadata about the response object. With the options parameter, you can pass in an object as the argument such asset the method you want to use, set the HTTP header, and set the body of the request. For example, as the options argument, you can define a mode as follows:

javascript
fetch('http://www...', {mode: 'same-origin'})

In the following example for Tipe, notice that our options is an object that includes your API Keys.

javascript

var YOUR_ORG_SECRET_KEY = ''
var YOUR_API_KEY = ''
window.fetch('https://api.tipe.io/api/v1/folder', {
  method: 'get',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': YOUR_API_KEY,
    'Tipe-Id': YOUR_ORG_SECRET_KEY
  }
})
  .then(function (res) { return res.json() })
  .then(function (data) {
    console.log(data)
        })

For more information on window.fetch(), see the Google Developers article Introduction to fetch().


Go further

Query Documents

Learn how to query Documents with REST.