1. Introduction
This tutorial will show you how to test the IPC OpenAPI with Postman.
Consult the Sunmi Technology Customer Service and get materials in the table below except the IP and SN of your device. And please connect your IPC to the Internet and make sure the blue LED is solid before going through the following steps.
Item | Example in this tutorial |
app_id | 08BABCDABBB661234567 |
secret_key | ABCDEFG3F2BB03917123 |
Activation Code | abcd2986jnts8987hntl1234 |
OpenAPI Cert and its password | openapi.p12 |
Postman Collections | Sunmi_IPC_OpenAPI_Postman_Collection_202007001.json |
IP | 192.168.103.198 |
SN | C201000P00123 |
2. Postman Setup
- Download Postman: Link, we use v7.27.1 in this tutorial.
- And just follow the Installation Wizard.
3. Collection Import and Configuration
- Launch Postman
- Click File -> Import -> Upload Files, And open the Postman collection from Sunmi, i.e. “Sunmi_IPC_OpenAPI_Postman_Collection_202007001.json”, confirm and click “Import”.
- Click File -> Settings -> Certificate, add the certificate file and its password, put the IP in the Host filed.
- 4. Open the General page, set “SSL certificate verificatio” to `OFF`.
- 5. Back to homepage of Postman, right click on “Sunmi IPC OpenAPI” collections, “Edit”, and update the corresponding settings at “CURRENT VALUE” in page “Variables”.
4. Activation Example
- Activation use the activation code as the secret key, Make sure the value of secret_key in the Variables page is your activation code.
- Open Sunmi IPC OpenAPI -> Basic -> 0. Activation, modify the “sn” to your device’s SN in the Body tab, click Send, activations succeed with “code” 0 in the response.
- Please find the detailed docment about activation in Device Management.
5. API Test
- This collection only includes several API example for testing. Each request needs to be correctly signed, see the Sign Rules.
- Sign script are included in this collection in “Pre-request Scripts”, it will calculate the value of “app_id”, “timestamp”, “random” and “sign” in every request.