Get contents

Inorder to retrieve the contents of a Dialogue and display it on your app, you need to first prepare the payload.

{
   "apiKey":"[Your API Key]",
   "emailHash":"[The hash of your email]",
   "slug":"[Your Slug]",
   "IsPilotVersion":null, //Set this to get Pilot data
   "variables":null, //Your variables and corresponding values if any.
   "pageSize":null, //In order to get paginated data.
   "pageIndex":null //In order to get paginated data.
}

Now that you have the payload ready, you can call the GetContents endpoint and POST the payload as part of the body.

If the contents are retrieved successfully, it will return you a response which will contain a status code, reason phrase and response. The status code indicates the standard HTTP response status codes and the reason phrase will contain the corresponding reason for the status code. The response will have the content which can be displayed on your app.

A sample response would look like the one below.

{
   "statusCode":200,
   "reasonPhrase":"OK",
   "response":{
      "dialogue":[
         {
            "dish-name":"Chicken Hot Dog",
            "dish-photo":"hotdog.jpg",
            "is-available":"true",
            "long-description":"Chicken Hot Dog with mayonnaise.",
            "price":"$7",
            "short-description":"Chicken Hot Dog with mayonnaise.",
            "id":"D82D0CA45C6044FAB4BDD6B9E0F5B31B",
            "isSourceAPI":"false"
         }
      ],
      "totalRecords":1,
      "error":""
   }
}

Every record will contain an id and isSourceAPI field. The id field is a unique identifier that can be used to update or delete the record. The isSourceAPI field indicates if the record was added through the API or manually through the portal.