IPC OpenAPI Testing Tutorial

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
Activation Codeabcd2986jnts8987hntl1234
OpenAPI Cert and its passwordopenapi.p12
Postman CollectionsSunmi_IPC_OpenAPI_Postman_Collection_202007001_en.json

2. Postman Setup

  1. Download Postman: Link, we use v7.27.1 in this tutorial.
  2. And just follow the Installation Wizard.

3. Collection Import and Configuration

  1. Launch Postman
  2. Click File -> Import -> Upload Files, And open the Postman collection from Sunmi, i.e. “Sunmi_IPC_OpenAPI_Postman_Collection_202007001_en.json”, confirm and click “Import”.
  3. 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

  1. Activation use the activation code as the secret key, Make sure the value of secret_key in the Variables page is your activation code.
  2. 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.

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.