Public parameters are used to identify the user and interface signature. If it is not necessary, these parameters will not be described in the separate interface document of each interface. However, each request needs to carry these parameters to initiate the request normally.
Public parameters need to be put in the HTTP header request header:
HTTP standard authentication header fields, for example:
K1-HMAC-SHA256 Credential=AKID******EXAMPLE/date/service/k1_request, SignedHeaders=content-type;host,Signature=fe5f80f77d5fa3beca038a248ff027d0445342fe2855ddc963176630326f1024
Description of each parameter:
- K1-HMAC-SHA256：Signature method, At present, this value is fixed;
- Credential：Signature certificate, AKID******EXAMPLE is AccessKey；
- date is the date of UTC standard time, and its value should be consistent with the UTC standard time date converted by the public parameter x-timestamp；
- Service is the product name, "cbms" is the fixed value for it.
- SignedHeaders: Content type and host are required header information for signature calculation;
- Signature: Signature Digest, see the following documents for the calculation process.
The value needs to be determined according to the actual environment.
For the development and test environment, the value is api-test.klavi.ai;
For the production environment, the value is api.klavi.ai.
Take the fixed value: application/json
Current UNIX timestamp, which can record the time when API request was initiated.
For example: 1529223702.
Note: if the time difference from the server is more than 5 minutes, the signature expiration error will be processed.
Take the fixed value: ap-brazil
Suppose that the partner wants to query the institutions list, the interface parameter is set to offset = 0, and the number of returns is limited to 10, then the request structure is shown as follows: request URL, request header, and request body.
Example of HTTP get request structure: