Treatment API
Common Request Information
Header Parameters
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| X-Authorization | string | true | Request authentication header. For authentication rules, see Authentication. Standard format: Bearer ${Access_token} |
| Accept | string | true | Must be set to application/json |
| Content-Type | string | true | Must be set to application/json |
HTTP Response Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded |
| 400 | Parameter error |
| 401 | Authentication failed. Please refer to Authentication to generate authentication information |
Business Error Codes
| Status Code | Error Code | Description | Solution |
|---|---|---|---|
| 400 | PARAM_ERROR | Parameter error | Check parameters according to the error description returned by the interface; parameters must be filled in accordance with the field filling instructions in the API documentation |
| 401 | SIGN_ERROR | Signature error | Permission verification exception. Please refer to the documentation in detail |
| 403 | NO_AUTH | No permission | Apply for permissions related to this interface on the platform |
| 429 | FREQUENCY_LIMITED | Frequency limit exceeded | Request frequency exceeds the limit. Please reduce the frequency of interface requests |
| 500 | SYSTEM_ERROR | System error | System exception. Please call again with the same parameters |
Treatment Entity Information
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| id | string(36) | false | [Record ID] Unique identifier of the record |
| petId | string(36) | true | [Pet ID] Associated pet |
| symptoms | string(36) | false | [Symptoms] Description of the pet's symptoms |
| treatments | string(36) | false | [Treatments] Description of drugs used to treat the pet |
| temp | double | false | [Temperature] Recorded temperature of the pet when ill |
| tempUnit | string(36) | false | [Temperature Unit] Optional values: ℃, ℉, default is ℉ |
| status | integer | true | [Status] 0 = Under treatment, 1 = Treatment completed, 2 = Deceased |
Add or Update Treatment
Interface Description
Request Method: [POST] /api/treatmentRecord/save
Request Domain: [Primary Domain] https://iot.seismi.co
Body Parameters
Input parameters follow the alert entity field specifications, and you only need to pass the required parameters; when id in the request body is empty, a new addition operation is performed; if it is not empty, data update is performed according to id.
Response Parameters
200 OK
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| code | integer | true | Business status code |
| msg | string(32) | true | Response message |
Delete Treatment
Interface Description
Request Method: [DELETE] /api/treatmentRecord/${id}, where id is the treatment ID in the system
Request Domain: [Primary Domain] https://iot.seismi.co
Response Parameters
200 OK
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| code | integer | true | Business status code |
| msg | string(32) | true | Response message |
Request Examples
Replace ${Access_token} below with the actual access token you retrieved.
Add Treatment
curl Example
In the sample data below, replace xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx with the animal ID obtained from your previous successful creation request.
POST
curl -X POST \
https://iot.seismi.co/api/treatmentRecord/save \
-H "X-Authorization: Bearer ${Access_token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"petId" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status" : 0,
"symptoms" : "test",
"treatments" : "test",
"temp" : 105.2,
"tempUnit" : "℉"
}'
Response Example
200 OK
{
"code" : "200",
"msg" : "success",
"data" : {}
}
The screenshot below shows the API response content. The ID circled in the image is a 36-character UUID. This ID is required for all subsequent update and delete operations.
Delete Treatment
curl Example
Replace xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx with the 36-digit UUID ID returned from your previous creation request.
DELETE
curl -X DELETE \
https://iot.seismi.co/api/treatmentRecord/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \
-H "X-Authorization: Bearer ${Access_token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
Response Example
200 OK
{
"code" : "200",
"msg" : "success",
"data" : {}
}