Responses

Content-type

The API responds with Content-Type set to application/json and JSON content. In case of success, the HTTP status code is 200 and the content contains result according to the call. In case of error, there are multiple HTTP status codes for different types of errors:

Response codes

  • 400 Bad Request – Error caused by the client app, e.g. in case of malformed request or invalid identifier of a resource. In most cases, such an error signifies a bug in the client app (consumer of the API).
  • 401 Unauthorized – Error caused by usage of invalid ClientToken, AccessToken, or you may not have the necessary permission to use the endpoint.
  • 403 Forbidden – Server error that should be reported to the end user of the client app. Happens for example when the server-side validation fails or when a business-logic check is violated.
  • 408 Request Timeout – Error caused by heavy requests that takes too long to process (in magnitude of tens of seconds). To get around this send/request data in smaller batches.
  • 429 Too Many Requests – Error caused by too many requests sent in a given amount of time, please see Request limits for more information.
  • 500 Internal Server Error – Unexpected error of the server. In most cases, such an error signifies a bug on our side. We are logging it and are immediately notified when such an error happens. If anything like this happens, feel free to directly contact us or raise an issue here on Github.

Response details

In case of success, the HTTP status code is 200 and the content contains result according to the call.

{
    "result": {
      "rstatus": 1,
      "messages": "DLM entry added successfully",
      "errorcode": "200"
    },
    "data": {
      "guest_id": 2394,
      "property_id": 7,
      "problem_id": 1173,
      "department_id": "169",
      "problem_category_id": "146",
      "incident_details": "test api",
      "logbook_entry_status_id": "1",
      "recovery_value": null,
      "incident_location": "147",
      "experience": "Complaint",
      "incident_date": {
        "date": "2022-05-19 14:40:20.000000",
        "timezone_type": 2,
        "timezone": "GMT"
      },
      "department_alert": "613,614,615,616",
      "logged_by": 8,
      "logged_on": {
        "date": "2022-05-19 14:40:20.000000",
        "timezone_type": 2,
        "timezone": "GMT"
      },
      "external_guest": "no",
      "type": "guest",
      "source_from": "api",
      "updated_at": {
        "date": "2022-05-19 14:40:20.000000",
        "timezone_type": 2,
        "timezone": "GMT"
      },
      "created_at": {
        "date": "2022-05-19 14:40:20.000000",
        "timezone_type": 2,
        "timezone": "GMT"
      },
      "id": 1769,
      "lea_attachments": [],
      "users": {
        "id": 8,
        "username": null,
        "password": "$2y$10$Hh72W4vCY9QdrkhT38czZerHwKnUx11668pVnBk/CYd/66CbhZz5S",
        "first_name": "CSPL",
        "last_name": "Free",
        "mobile": "12345684125",
        "mobile_code": "cn",
        "phone": "12385744587",
        "phone_code": "ug",
        "email": "csplfree@yopmail.com",
        "position_id": "584",
        "address_id": "9",
        "last_login_timestamp": {
          "date": "2022-05-19 08:22:36.000000",
          "timezone_type": 2,
          "timezone": "GMT"
        },
        "current_login_timestamp": "2022-05-19 09:54:46",
        "language_id": "3",
        "timezone_id": null,
        "status": "1",
        "avatar": "9c47321fa61f9c36a1c09b3e2640a9d8880.png",
        "login_count": "1526",
        "login_token": "axonF4QI12cZjqaph1Smu2jpaxHfue9D",
        "is_configure": "no",
        "remember_token": "AG5nVkwskJrsgaMAbOKUbwhhsfIwySVwb3VuvqfZDA7VARisqplhWPnFfgQC",
        "created_at": {
          "date": "2020-05-23 04:20:57.000000",
          "timezone_type": 2,
          "timezone": "GMT"
        },
        "updated_at": {
          "date": "2022-05-19 09:54:46.000000",
          "timezone_type": 2,
          "timezone": "GMT"
        },
        "deleted_at": null,
        "is_freetrail": "0",
        "about_me": "This is some simple introduction text coming from the BPN Profile View.",
        "designation": "Manager",
        "is_show_msg": "true",
        "is_show_modal": ",11,9,2,1,7,12,13",
        "is_grm_broadcast": "1"
      }
    }
  }

In case of any error, the returned JSON object describes the error and has the following

{
    "result": {
        "rstatus": 0,
        "messages": "Invalid access key",
        "errorcode": "401"
    }
}

Some errors may also contain additional information relevant to the error on top of these two properties. This depends on the operation.

API NameCodeError Code DescError Message
All500  Internal Server ErrorThe request was not completed due to an internal error on the server side.
All401Unauthorizedapi key is blank
All401Unauthorizedapi key is invalid
All401Unauthorizedapi secret is blank
All401Unauthorizedapi secret is invalid
All401Unauthorizedapi key or secret key is wrong
dlm/problem_location_list200SuccessGet list of problems, property locaitons successfully
dlm/store101Missing parametermissing room number
dlm/store101Missing parametermissing problem id
dlm/store101Missing parametermissing property_location
dlm/store200Passed value is invalidEntered problem id not found in property problems. make sure you entered correct problem id.
dlm/store200Passed value is invalidEntered property_location id not found in property locations. make sure you entered correct property_location id.
grm/list_request200SuccessGet list of requests successfully
grm/store101Missing parametermissing room number
grm/store101Missing parametermissing request_id
grm/store200Passed value is invalidEntered request id not found in property guest request. make sure you entered correct request id.
grm/store200ErrorL1 and L2 devices are offline so unable to create GRM request

Updated on May 20, 2022

Was this article helpful?

Related Articles

Leave a Comment