API keys are useful for accessing public data anonymously, and are used to associate API requests with the consumer. API Keys provides you a programmatic interface to create and manage API keys for your project. When you use API keys in your applications, ensure that they are kept secure during both storage and transmission. Publicly exposing your credentials can result in your account being compromised.
An API key is a simple encrypted string that you can use when calling Uptok’s API’s services.
When viewing the API keys page, you will see a list of your current API keys along with the following information:
Once you delete a key, it can no longer be used to access Uptok’s services. Click the action menu in the same row as the key you want to delete. Click on the Delete icon. This will delete the key permanently.
A typical use of an API key is to pass the key into a REST API call, in the body as a key value pair in form-data. Where clientKey will be the name of the key and value will be the key provided at the time of creation of an API key. Pagination is also implemented in it. You will have to pass page number in body while requesting for data and you will receive the JSON data along-with the number of total sessions, total pages and records per page.
const formData = new FormData()
formData.append('clientKey', 'Your secret key')
formData.append(‘page’, pageNumber) Optional
formData.append(‘perPage’, pageLimit) Optional
const Url = ‘${BaseUrl/api/sessions/export-csv-data’
fetch('Url', {
method: 'POST',
body: formData
},
headers: {
'Content-Type': 'multipart/form-data',
},
)
.then(res => res.json())
.then(data => {
console.log(data)
})