API response format

All responses by the HiveSocial 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": 1,
    "type": "bookmark",
    "group": {
      "id": "e532e792-4101-4ef5-8cd7-68380bbbc703",
      "name": "fugiat",
      "slug": "Home",
      "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png",
      "url": "http://demo.hivesocialnow.com/Home/"
    },
    "description": "ex minim",
    "url": "http://www.microsoft.com",
    "targetBlank": true,
    "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": 969,
    "bookmarks": [
      {
        "id": 1,
        "type": "bookmark",
        "group": {
          "id": "83acbf0f-b920-4ecb-a61e-e85bbfaaa52f",
          "name": "ea",
          "slug": "Home",
          "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png",
          "url": "http://demo.hivesocialnow.com/Home/"
        },
        "description": "quis dolor",
        "url": "http://www.microsoft.com",
        "targetBlank": true,
        "accessWarnings": []
      },
      {
        "id": 2,
        "type": "bookmark",
        "group": {
          "id": "fa154391-64e4-49d1-9930-02b0f804174a",
          "name": "officia",
          "slug": "Home",
          "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png",
          "url": "http://demo.hivesocialnow.com/Home/"
        },
        "description": "aliqua dolore",
        "url": "http://www.microsoft.com",
        "targetBlank": true,
        "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": 1,
    "type": "bookmark",
    "group": {
      "id": "e532e792-4101-4ef5-8cd7-68380bbbc703",
      "name": "fugiat",
      "slug": "Home",
      "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png",
      "url": "http://demo.hivesocialnow.com/Home/"
    },
    "description": "ex minim",
    "url": "http://www.microsoft.com",
    "targetBlank": true,
    "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:
  • key - the property name, if any, which validation or execution returned an error
  • value - the property value, that causes the problem
  • message - human readable message of the error
object object the object returned by the method. In this object there are the following common properties:
  • offset - presented when the returned object is a list of objects. Represents the ID of the last element in the list. It is used for requesting the next batch of items via an infinite scroll user interface
  • type - the returned object type. Often used for subsequent object serialization
  • accessWarnings - here are provided list of warnings that apply to the provided data. Provided when the real data in the system is different from the provided, because of possible user access restrictions