Subscriptions API

Management

Creating a subscription

post

Register partner webhookUrl to HanChuESS under specified event types.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
oemstringRequired

Partner client id

Example: H03Z****SY37
webhookUrlstringRequired

The HTTPS URL that subscription payloads shouldbe sent to

Example: https://partner.tech/api/callback
eventsstring[]Optional

List of events which subscribe to, default ["*"]

Example: ["inverter:data:telemetry","hanchuess:subscription:test"]
secretstringRequired

A cryptographically secure secret, generated and provided by your platform

Example: JSrruXM******yrWaTz
versionstringOptional

The version of the webhooks, HanChuESS will set in http header by key X-Api-Version when invoke

Example: 1.0.0
devicesstring[]Required

List of device identifiers which subscribe to

Example: ["H01****G1H","H02****D6C"]
Responses
200

Operation was successful

application/json
post
/v1/oem/subscribe
POST /portal/v1/oem/subscribe HTTP/1.1
Host: idaas-sandbox.hanchuess.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 225

{
  "oem": "H03Z****SY37",
  "webhookUrl": "https://partner.tech/api/callback",
  "events": [
    "inverter:data:telemetry",
    "hanchuess:subscription:test"
  ],
  "secret": "JSrruXM******yrWaTz",
  "version": "1.0.0",
  "devices": [
    "H01****G1H",
    "H02****D6C"
  ]
}
{
  "errno": "text",
  "msg": "text",
  "data": {
    "oem": "H03Z****SY37",
    "subscriptionId": "72PX****j6j",
    "webhookUrl": "https://partner.tech/api/callback",
    "events": [
      "inverter:data:telemetry",
      "hanchuess:subscription:test"
    ],
    "version": "1.0.0",
    "status": "inactive",
    "lastSuccessfulMessage": "2025-03-01T12:08:59Z",
    "createAt": "2025-03-01T11:25:02Z",
    "devices": [
      "H01****G1H",
      "H02****D6C"
    ]
  }
}

List current subscriptions

post

Get your subscription list.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
oemstringRequired

Partner client id

Example: H03Z****SY37
Responses
200

Operation was successful

application/json
post
/v1/oem/subscriptions
POST /portal/v1/oem/subscriptions HTTP/1.1
Host: idaas-sandbox.hanchuess.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 22

{
  "oem": "H03Z****SY37"
}
{
  "devices": [
    {
      "errno": "text",
      "msg": "text",
      "data": {
        "oem": "H03Z****SY37",
        "subscriptionId": "72PX****j6j",
        "webhookUrl": "https://partner.tech/api/callback",
        "events": [
          "inverter:data:telemetry",
          "hanchuess:subscription:test"
        ],
        "version": "1.0.0",
        "status": "inactive",
        "lastSuccessfulMessage": "2025-03-01T12:08:59Z",
        "createAt": "2025-03-01T11:25:02Z",
        "devices": [
          "H01****G1H",
          "H02****D6C"
        ]
      }
    }
  ]
}

Update subscription

post

Modify your subscriptions.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
oemstringRequired

Partner client id

Example: H03Z****SY37
subscriptionIdstringRequired

Subscribe id

Example: RD*****ZrWO
webhookUrlstringOptional

The HTTPS URL that subscription payloads shouldbe sent to

Example: https://partner.tech/api/callback
eventsstring[]Optional

List of events which subscribe to, default ["*"]

Example: ["inverter:data:telemetry","hanchuess:subscription:test"]
secretstringOptional

A cryptographically secure secret, generated and provided by your platform

Example: JSrruXM******yrWaTz
versionstringOptional

The version of the webhooks, HanChuESS will set in http header by key X-Api-Version when invoke

Example: 1.0.0
devicesstring[]Optional

List of device identifiers which subscribe to

Example: ["H01****G1H","H02****D6C"]
Responses
200

Operation was successful

application/json
post
/v1/oem/resubscribe
POST /portal/v1/oem/resubscribe HTTP/1.1
Host: idaas-sandbox.hanchuess.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 256

{
  "oem": "H03Z****SY37",
  "subscriptionId": "RD*****ZrWO",
  "webhookUrl": "https://partner.tech/api/callback",
  "events": [
    "inverter:data:telemetry",
    "hanchuess:subscription:test"
  ],
  "secret": "JSrruXM******yrWaTz",
  "version": "1.0.0",
  "devices": [
    "H01****G1H",
    "H02****D6C"
  ]
}
{
  "errno": "text",
  "msg": "text",
  "data": {
    "oem": "H03Z****SY37",
    "subscriptionId": "72PX****j6j",
    "webhookUrl": "https://partner.tech/api/callback",
    "events": [
      "inverter:data:telemetry",
      "hanchuess:subscription:test"
    ],
    "version": "1.0.0",
    "status": "inactive",
    "lastSuccessfulMessage": "2025-03-01T12:08:59Z",
    "createAt": "2025-03-01T11:25:02Z",
    "devices": [
      "H01****G1H",
      "H02****D6C"
    ]
  }
}

Delete subscription

delete

Unsubscribe oem webhookUrl which already registered in HanChuESS.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
oemstringRequired

Partner client id

Example: H03Z****SY37
subscriptionIdstringRequired

The unique identifier for the subscription

Example: 72PX****j6j
Responses
200

Operation was successful

application/json
delete
/v1/oem/{oem}/unsubscribe/{subscriptionId}
DELETE /portal/v1/oem/{oem}/unsubscribe/{subscriptionId} HTTP/1.1
Host: idaas-sandbox.hanchuess.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "errno": 200,
  "msg": "The operation has been successful",
  "data": {
    "...": null
  }
}

Test subscription

post

Test your subscription and active its status when succeeded.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
oemstringRequired

Partner client id

Example: H03Z****SY37
subscriptionIdstringRequired

Subscribe id

Example: 72PX****6j
Responses
200

Operation was successful

application/json
post
/v1/oem/subscriptions/test
POST /portal/v1/oem/subscriptions/test HTTP/1.1
Host: idaas-sandbox.hanchuess.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 52

{
  "oem": "H03Z****SY37",
  "subscriptionId": "72PX****6j"
}
{
  "testStatus": "SUCCEEDED",
  "data": {
    "code": 200,
    "body": "pong"
  }
}

Last updated