-
Notifications
You must be signed in to change notification settings - Fork 1
Input and Output Specifications
- GET - an idempotent operation to retreive data from the API.
- POST - create a new record in the API.
- PUT - modify an existing record in the API.
- DELETE - remove a record from the API.
-
Accept - must be
application/json
- Authorization - your Authorization String. How to get my Authorization string?
-
Content-Type - for requests with data payload, this should be
application/json
. This is optional for requests with no data payload.
The data parameter object is placed at the body of the HTTP meessage, and must JSON-encoded. The actual structure of the data parameter object depends on the needs of the API method.
The output of the GCORE API is a JSON-encoded object, with at least the following attributes: message - a human-readable string that says something about the result of the preceding operation. model - the object payload of the preceding operation. This may or may not be present in the response. The object payload may be composed of a single object, or an array of objects.
GCORE API uses a subset of the HTTP response codes.
- 200 - the operation was successfully accomplished, with no errors.
- 401 - the user has not yet logged in.
- 403 - the user has logged in, but has no authorization to do the operation.
- 404 - the API method being called does not exist.
- 500 - an error happened while processing the operation.
- 501 - there are future plans to have this API method, but it has not yet implemented.
Below are some of the headers being returned by the GCore API. Each API resource may add additional headers.
-
Content-Type - Always
application/json; charset=utf-8
. Your client should then be able to parse the JSON output properly. - X-GCore-Version - The current version of the GCore API.
-
Access-Control-Allow-Origin - Current value is
*
, indicating that the GCore API supports Cross Origin Resource Sharing (CORS), allowing JavaScript code to call the GCore API via AJAX.
As with the input, the output is also a JSON-encoded string.
Questions? Spotted a documentation error? Or just want to say hi? Please leave a message at https://github.com/galorelabs/gcore/issues, and we'll get back to you as soon as we can. :)