General Specifications

Host

This is the primary host of the API paths: https://services.sparkart.net/api/v1

Requests/Responses

All requests need to be submitted in JSON format and all responses will be
returned in JSON. The HTTP response code will always be a 200 Success
regardless of the status.

Cross-Site Requests

We are using CORS headers in order to use this API across domains. Adding
trusted domains to your fanclub can be done from Sparkart Tools:

Go to the Settings tab

From there, go to the Site URLs sub-tab

NOTE: For browsers that do not support CORS headers, we default to JSONP
instead.

Current Customer

Throughout these documents you'll notice the term current customer being used.
current customer is referring to the currently logged in customer whose ID is
saved in the session. Almost all endpoints in this API will require a current customer to be set in order to get the desired responses. If the current customer has not both registered and confirmed their email they will be in a
logged out state. API responses for customers in this state will look like the
following:

Authentication

All endpoints, both GET and POST actions, require an API key (key parameter)
to be passed in with the request. Your API key is unique to your fanclub and can
be found under the Settings tab from Sparkart Tools.

Error Handling

Since all endpoints respond with a 200 Success, you will need to inspect the
actual JSON response body to get the status of the response.

Status

Response

success

ok

failure

error

Almost all errors responses will be accompanied by an array of error messages

Examples

GET/some_endpoint?key=YOUR_API_KEY

As stated above, you must include key=YOUR_API_KEY in every request. Otherwise
you will get the failure response every time.