API response format
All responses by the HiveSocial Gamification API are in JSON formatted in specific way. The general examples are:
Responding to GET a single object
{ "success": true, "message": "Nisi proident tempor cillum sint duis eu elit dolor Lorem amet qui officia occaecat.", "timestamp": "2014-03-03T23:20:23Z", "errors": [], "object": { "id": "0ed40157-61c8-447e-87aa-744f579e4efa", "type": "player", "name": "Bob", "experience":0, "level":1, "levelStartExperience": 0, "levelEndExperience": 99, "isPublicProfile": false, "lastLogNotifation": null, "lastLogRead": null, "lastModified": "2014-12-11T10:21:48.9182343+02:00", "quests": [], "cards": [], "log":[], "accessWarnings": [] } }
Returning to GET a list of objects
{ "success": true, "message": "Esse anim incididunt duis nostrud veniam nisi ut non in duis dolor cupidatat enim.", "timestamp": "2014-03-03T23:20:23Z", "errors": [], "object": { "offset": "0ed40157-61c8-447e-87aa-744f579e4efa", "players": [ { "id": "0ed40157-61c8-447e-87aa-744f579e4efa", "type": "player", "name": "Bob", "experience":0, "level":1, "levelStartExperience": 0, "levelEndExperience": 99, "isPublicProfile": false, "lastLogNotifation": null, "lastLogRead": null, "lastModified": "2014-12-11T10:21:48.9182343+02:00", "quests": [], "cards": [], "log":[], "accessWarnings": [] } ] } }
Returning to POST,PUT,DELETE an object
{ "success": false, "message": "Aliqua anim consequat amet cupidatat proident amet amet.", "timestamp": "2014-03-03T23:20:23Z", "errors": [ { "key": "url", "value": "", "message": "URL cannot be blank" }, { "key": "targetBlank", "value": "", "message": "some sample error" } ], "object": { "id": "0ed40157-61c8-447e-87aa-744f579e4efa", "type": "player", "name": "Bob", "experience":0, "level":1, "levelStartExperience": 0, "levelEndExperience": 99, "isPublicProfile": false, "lastLogNotifation": null, "lastLogRead": null, "lastModified": "2014-12-11T10:21:48.9182343+02:00", "quests": [], "cards": [], "log":[], "accessWarnings": [] } }
property | value | description |
---|---|---|
success | boolean | whether the method execution is successfully completed |
message | string | method execution result in human readable form. Often provided to the end-user as a feedback |
timestamp | date | when the method was executed in ISO 8601 date string and UTC time zone |
errors | List of objects | list of error objects returned during the method execution. It is empty when no errors are reported. The object format is:
|
object | object | the object returned by the method. In this object there are the following common properties:
|