Authentication
Authentication allows us to know if the resource has been requested by a valid user.
A user authenticate a request by providing ‘Bearer token’ as an Authorization header to your requests.
Example
You can use any of the example below as a reference :1
2curl -H "Authorize: Bearer unique-token-id"
https://manage.searchtap.net/v2/collections?appId=UNIQUEAPPID&count=10&skip=0
or you can some request libraries such as ‘axios’, like mentioned below1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16// replace 'unique-token-id' with your app token id
const instance = axios.create({
baseURL: 'https://manage.searchtap.net/v2',
headers: {'Authorize': 'Bearer unique-token-id'}
});
axios({
method: 'get',
url: '/collections?appId=UNIQUEAPPID&count=10&skip=0',
})
.then(function (response) {
// do something with response
})
.catch(function (error) {
// do something with error
})
All the read and write operations need App tokens, these tokens can be found at the App listing page where you find a ‘key shape’ icon over every app.
Authentication error
In event of an unauthorized request, the API server throws an unauthorized object with a message
1 | { |