REST API v2.15

Influencer Codes

Collection of type influencercode.

Get Influencer Codes

Endpoint

GET sites/{siteid}/influencercodes

Parameters

start

The index of the item to start fromDefault: 0

num

The number of items returnedDefault: 10

fields

Comma separated list of fields to return. Use this to query only the fields you are using. See influencercode for all fields.

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an envelope with items of type influencercode.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/influencercodes.json?num=2

Response

{ "totalcount": 2, "items": [ { "code": "PREPARE4SUMMER", "name": "Taylor Smith", "active": true, "datestart": 1555711200, "dateend": 1559339999, "voucherpassword": "Lzs5MvMr", "vouchercode": null, "vouchername": null, "vouchercomment": null, "maxuses": 1000, "numused": 2, "datelastused": 1556466245, "moneyordertotal": "174.00", "moneyinfluencertotal": "97.00", "moneyinfluencerdiscount": "38.00" }, { "code": "RUN-FASTER-2019", "name": "Joe Mason", "active": true, "datestart": 1548975600, "dateend": null, "voucherpassword": "dJTv4gHE", "vouchercode": null, "vouchername": null, "vouchercomment": "Discount on smartwatches.", "maxuses": 600, "numused": 1, "datelastused": 1549985297, "moneyordertotal": "1250.00", "moneyinfluencertotal": "1000.00", "moneyinfluencerdiscount": "250.00" } ] }

Batch Add Influencer Codes

Endpoint

POST sites/{siteid}/influencercodes

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns batch envelope with influencer codes.

Example

Request

POST https://api.mysitoo.com/v2/accounts/1500/sites/1/influencercodes.json [ { "code": "SCRAPBOOK101", "name": "Emily Hadfield", "active": false, "voucherpassword": "RLFm3bef", "vouchername": "All scrapbooks 10% off", "maxuses": 1400 } ]

Response

[ { "statuscode": 200, "return": "SCRAPBOOK101" } ]

Get Influencer Code

Endpoint

GET sites/{siteid}/influencercodes/{code}

Parameters

fields

Comma separated list of fields to return. Use this to query only the fields you are using. See influencercode for all fields.

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an item of type influencercode.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/influencercodes/SCRAPBOOK101.json

Response

{ "code": "SCRAPBOOK101", "name": "Emily Hadfield", "active": false, "datestart": null, "dateend": null, "voucherpassword": "RLFm3bef", "vouchercode": null, "vouchername": "All scrapbooks 10% off", "vouchercomment": null, "maxuses": 1400, "numused": 0, "datelastused": null, "moneyordertotal": "0.00", "moneyinfluencertotal": "0.00", "moneyinfluencerdiscount": "0.00" }

Batch Update Influencer Codes

Endpoint

PUT sites/{siteid}/influencercodes

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns batch envelope with return value true on success.

Example

Request

PUT https://api.mysitoo.com/v2/accounts/1500/sites/1/influencercodes.json [ { "code": "SCRAPBOOK101", "maxuses": 2000 } ]

Response

[ { "statuscode": 200, "return": true } ]

Batch Delete Influencer Codes

Endpoint

DELETE sites/{siteid}/influencercodes

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns batch envelope with return value true on success.

Example

Request

DELETE https://api.mysitoo.com/v2/accounts/1500/sites/1/influencercodes.json [ { "code": "SCRAPBOOK101" } ]

Response

[ { "statuscode": 200, "return": true } ]