Skip to main content
POST
/
device
/
hsc
/
chunk
Upload Script Points Chunk
curl --request POST \
  --url https://api.getmelody.io/device/hsc/chunk \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "script_id": 12345,
  "upload_id": 1,
  "chunk_id": 0,
  "points": [
    {
      "time": 1000,
      "pos": 50
    }
  ],
  "total_chunks": 1,
  "total_points": 100
}
'
{
  "message": "ok"
}

Authorizations

Authorization
string
header
required

Device Token for SDK operations. Obtain via: GET /api/haptics/device/device_token Format: {device_id}-{1|2}-{random} Note: ApiToken (from POST /device/otp/confirm) can also be used for most SDK endpoints.

Body

application/json

Request body for uploading script points to the device.

script_id
integer<int64>
required

Unique identifier for the script on the current device.

Example:

12345

upload_id
integer<uint32>
required

Unique identifier for this upload session.

Example:

1

chunk_id
integer<uint32>
required

Sequence number of this chunk (starting from 0 or 1).

Example:

0

points
object[]
required

Array of script points to upload.

total_chunks
integer<uint32>
required

Total number of chunks in this upload session.

Example:

1

total_points
integer<uint32>
required

Total number of points in the script.

Example:

100

Response

OK

Standard success response.

message
string

Response message.

Example:

"ok"