Making the first API Call

Prerequisites

  • A pair of API key ID and API key secret, like, for example:

    key ID: 68b99121-ab14-4c50-ae32-483fd81ed5bd

    key secret: yADmXL6z#3cVn-YDO6blMi2lf40JM0GTpZKT~~R75yCD7vYTe6~bSu2D9Fp4qDV9xEhmVdYK

  • Some credits for any of the workflows. For the sake of simplicity, we will assume that you have bought credits for the Document Simple Forensics API.

If one of the previous steps is missing, then go to First Steps.

Setting up the authentication

WT uses BASIC authentication via the HTTP Authorization request header. As per the documentation, to set up the content of this header, we have to concatenate the key ID and the key secret in the following manner:

<key id>:<key secret>

Using the values we already have, the resulting concatenation should be

68b99121-ab14-4c50-ae32-483fd81ed5bd:yADmXL6z#3cVn-YDO6blMi2lf40JM0GTpZKT~~R75yCD7vYTe6~bSu2D9Fp4qDV9xEhmVdYK

Now, last but not least, this string has to be encoded using Base64:

NjhiOTkxMjEtYWIxNC00YzUwLWFlMzItNDgzZmQ4MWVkNWJkOnlBRG1YTDZ6IzNjVm4tWURPNmJsTWkybGY0MEpNMEdUcFpLVH5+Ujc1eUNEN3ZZVGU2fmJTdTJEOUZwNHFEVjl4RWhtVmRZSw==

Using this base64-encoded string, we can finally build the header

Authorization: Basic NjhiOTkxMjEtYWIxNC00YzUwLWFlMzItNDgzZmQ4MWVkNWJkOnlBRG1YTDZ6IzNjVm4tWURPNmJsTWkybGY0MEpNMEdUcFpLVH5+Ujc1eUNEN3ZZVGU2fmJTdTJEOUZwNHFEVjl4RWhtVmRZSw==

Making the call

Let us make one of the most common calls, the GET /signatures. Since we haven’t created any signatures so far, it should respond with an empty array.

There are other headers that we must specify, like:

Content-Type: application/json
Accept: application/json

Now let us build our first API request:

Example
curl https://api.webtrust.kopjra.com/v1/signatures -H "Content-type: application/json" -H "Accept: application/json" -H "Authorization: Basic NjhiOTkxMjEtYWIxNC00YzUwLWFlMzItNDgzZmQ4MWVkNWJkOnlBRG1YTDZ6IzNjVm4tWURPNmJsTWkybGY0MEpNMEdUcFpLVH5+Ujc1eUNEN3ZZVGU2fmJTdTJEOUZwNHFEVjl4RWhtVmRZSw=="

As a response, you should receive the following json

{
  items: [],
  total: 0
}

Ok, now you are all set for creating a signature.