The Shuuraku API is organized around REST and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. JSON is returned by all API responses, including errors.
Authenticate your account by including your token in API requests. Do not share your token publicly on accessible areas such GitHub, client-side code, and so forth.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Shuuraku uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Shuuraku's servers (these are rare).
Some 4xx errors that could be handled programmatically include an error code that briefly explains the error reported.
200 - OK - Everything worked as expected.
400 - Bad Request - The request was unacceptable, often due to missing a required parameter.
401 - Unauthorized - No valid API key provided.
402 - Request Failed - The parameters were valid but the request failed.
404 - Not Found - The requested resource doesn't exist.
429 - Too Many Requests - Too many requests hit the API too quickly.
5XX - Server Errors - Something went wrong on Shuuraku's end.
{"result":{"id_marketing_item":"00000000-0000-4000-a000-000000000002","url":"https://www.shuuraku.com/countdown/abcdefg1234567890.gif"}}
{"result":[{"id_marketing_item":"00000000-0000-4000-a000-000000000000","date_created":"2018-01-02 03:04:05","marketing_item_type":"Countdown","url":"https://www.shuuraku.com/countdown/abcdefg1234567890a"},{"id_marketing_item":"00000000-0000-4000-a000-000000000001","date_created":"2018-01-02 03:04:05","marketing_item_type":"Countdown","url":"https://www.shuuraku.com/countdown/abcdefg1234567890b"},{"id_marketing_item":"00000000-0000-4000-a000-000000000002","date_created":"2018-01-02 03:04:05","marketing_item_type":"Countdown","url":"https://www.shuuraku.com/countdown/abcdefg1234567890c"}]}
{"result":{"id_marketing_item":"00000000-0000-4000-a000-000000000001","date_created":"2018-01-02 03:04:05","marketing_item_type":"Countdown","options":{"colour":"#ff0000","countdown_date_time":"2018-12-25 00:00:00","countdown_expired_message":"Countdown complete","countdown_link":"https://www.shuuraku.com","countdown_message":"Countdown to my event","countdown_show_labels":"1","countdown_timezone":"America\/New_York","font":"1","size":"48"},"url":"https://www.shuuraku.com/countdown/abcdefg1234567890"}}
{"result":[{"id_payment":"00000000-0000-4000-a000-000000000000","date_created":"2018-01-31 03:04:05","payment_total":"79.99"},{"id_payment":"00000000-0000-4000-a000-000000000001","date_created":"2018-02-28 03:04:05","payment_total":"79.99"}]}
{"result":{"id_payment":"00000000-0000-4000-a000-000000000001","date_created":"2018-02-28 03:04:05","billing_first_name":"Paxton","billing_last_name":"Smith","billing_address_1":"12 Avenue Avenue","billing_address_2":"Suite 200","billing_country":"CA","billing_province_state":"ON","billing_city":"Toronto","billing_zip_postal_code":"A1B2C3","billing_phone":"4165551234","payment_total":"79.99","card_type":"Visa","card_masked_number":"**** 1111","plan":"Enterprise"}}
{"result":{"plan":"Free","plan_maximum_view_count":20000,"plan_maximum_view_count_exceeded":false,"current_view_count":0}}