How to use the pre-request script?
For Postman, simply add the given code snippet into postman pre-request script tab. Postman Pre-Request Script:Why pre-request script is needed?
We use checksum calculation in pre-request script, It is required to authenticate the CHIP Send API. It acts as an extra layer of protection to mitigate data tampering and prevent replay attacks.Pre-request script in other languages
Example Ruby code:FAQ
Frequently asked questions regarding pre-request script.-
Where can I get
api_key
andapi_secret
?
Forapi_key
, you can obtain it from the CHIP Control Applications
Forapi_secret
, you need to request from CHIP sales team -
What hashing algorithm is used for pre-request script?
The hashing algorithm used isSHA-512