![]() |
Razer Chroma SDK
v3.2
Razer Chroma SDK REST Documentation
|
Creating effects on Mice by sending PUT or POST to the URI. POST will return an effect id.
Endpoint
/mouse
Remarks
Each parameters are different depending on the types of effect. Data parameters closely represented by the data structures in the C++ interface defined in RzChromaSDKTypes.h.
To turn off effect use CHROMA_NONE.
Method
PUT
/POST
JSON Data
Field | Description | Type |
---|---|---|
"effect" | Effect type. | String |
{ "effect": "CHROMA_NONE" }
Response (PUT):
Field | Description | Type |
---|---|---|
"result" | Error code defined in RzErrors.h | Number |
{ "result" : 0 }
Response (POST):
Field | Description | Type |
---|---|---|
"result" | Error code defined in RzErrors.h. | String |
"id" | An identifier associated with the effect | String |
{ "result" : 0 "id": "9E61C0E2-9E46-4EC9-962C-9E36C7FE20C3" }
To create a static effect use CHROMA_STATIC and specify the color value.
Method
PUT
/POST
JSON Data
Field | Description | Type |
---|---|---|
"effect" | Effect type | String |
"param" | Effect definition | Object |
"color" | Color value in BGR format | Number |
{ "effect": "CHROMA_STATIC", "param": { "color": 255 }, }
Response (PUT):
Field | Description | Type |
---|---|---|
"result" | Error code defined in RzErrors.h | Number |
{ "result" : 0 }
Response (POST):
Field | Description | Type |
---|---|---|
"result" | Error code defined in RzErrors.h | Number |
"id" | An identifier associated with the effect | String |
{ "result" : 0 "id": "9E61C0E2-9E46-4EC9-962C-9E36C7FE20C3" }
To create a custom effect use CHROMA_CUSTOM2 and fill in the colors in each element in the array.
Method
PUT
/POST
Field | Description | Type |
---|---|---|
"effect" | Effect type | String |
"param" | 2 dimensional array of size 9 rows by 7 columns. Each cell contains the color value in BGR format | Array |
{ "effect":"CHROMA_CUSTOM2", "param":[ [ 255,255,255,255,255,255,255 ], [ 65280,65280,65280,65280,65280,65280,65280 ], [ 16711680,16711680,16711680,16711680,16711680,16711680,16711680 ], [ 65535,65535,65535,65535,65535,65535,65535 ], [ 16711935,16711935,16711935,16711935,16711935,16711935,16711935 ], [ 255,255,255,255,255,255,255 ], [ 65280,65280,65280,65280,65280,65280,65280 ], [ 16711680,16711680,16711680,16711680,16711680,16711680,16711680 ], [ 255,255,255,255,255,255,255 ] ] }
Response (PUT):
Field | Description | Type |
---|---|---|
"result" | Error code defined in RzErrors.h. | Number |
{ "result" : 0 }
Response (POST):
Field | Description | Type |
---|---|---|
"result" | Error code defined in RzErrors.h. | Number |
"id" | An identifier associated with the effect | String |
{ "result" : 0 "id": "9E61C0E2-9E46-4EC9-962C-9E36C7FE20C3" }
Creating a group of effects.
Method
POST
JSON Data
Field | Description | Type |
---|---|---|
"effects" | Array of effect definitions | Array |
{ "effects":[ { "effect":"CHROMA_NONE" }, { "effect":"CHROMA_STATIC", "param":{ "color":255 } }, { "effect":"CHROMA_CUSTOM2", "param":[ [ 255,255,255,255,255,255,255 ], [ 65280,65280,65280,65280,65280,65280,65280 ], [ 16711680,16711680,16711680,16711680,16711680,16711680,16711680 ], [ 65535,65535,65535,65535,65535,65535,65535 ], [ 16711935,16711935,16711935,16711935,16711935,16711935,16711935 ], [ 255,255,255,255,255,255,255 ], [ 65280,65280,65280,65280,65280,65280,65280 ], [ 16711680,16711680,16711680,16711680,16711680,16711680,16711680 ], [ 255,255,255,255,255,255,255 ] ] } ] }
Response:
Field | Description | Type |
---|---|---|
"results" | Array of results with effect ids | Array |
"id" | An identifier associated with the effect | String |
"result" | Error code defined in RzErrors.h. | Number |
{ "results": [ { "id": "CD4A68DA-061C-458B-B910-169AA22FF55B", "result": 0 }, { "id": "CB08DF54-7D0A-461A-8675-9D1BD2748C99", "result": 0 }, { "id": "F29AAC23-71AE-4ADE-9482-325FF1E6F92D", "result": 0 } ] }