UPTOK DEVELOPERS

API Documentation

UPTOK API

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. 

Managing API keys

When viewing the API keys page, you will see a list of your current API keys along with the following information:

  • Name- The name you defined for your API key.
  • Public Key- The secret key provided to you.
  • Client ID- Active Client Id of the client who created the key.
  • Created At- Date at which the key has been created.
  • Action- Actions you can perform on your API keys, such as deleting the key.

Creating an API key

  • Navigate to Settings on the left navigation bar, and then select API Keys.
  • Give your API key a name.
  • Click the Generate Key button.
  • Copy your API key somewhere safe. For security reasons, do not put it directly in your code, or commit it somewhere public like GitHub.

Deleting an API key

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.

Replacing an old API key with a new one

  • Locate the API key you would like to replace in your list of keys and click the Delete icon to delete the API key.
  • Next, create a new API key.
  • Replace the old API key with the new one in your code.

Testing an API key

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)
})

Question? We are all ears.

Thank you! Your request has been received!
Someone will contact you within a business day.
Oops! Something went wrong. Please try submitting again.