Cumulocity request/response template testing using Postman

I have registered smartREST template using Postman application for a cumulocity host of my project. These templates work correctly for Post requests like sending measurement, Alarms and so on.

Similarly, I have also registered Response templates for getting responses but I am not getting expected result in fact nothing value but only “200 OK”.

Registered request template is :

10,602,GET,/inventory/managedObjects/&&,,,&&,, 

(generated X-ID :2714)

And registered response template for getting a response of the above request is as follows.

11,504,,$.c8y_Mobile,$.imei

(Fragment c8y_Mobile and the value imei exist)

And a body of the request I am sending to the complicity using the registered template is as:

15,2714
602,2564  (2564 is the managed object id which is correct)

How does the response template work in Cumulocity? Do I have to provide the cumulocity also Response template X-ID in order to get the correct answer for a particular request having the “GET” method?

I have not linked anywhere request and response templates. I don’t know how to link a request and a response template using Postman. I am assuming that the cumulocity will use the registered response template… Any lead or further clarification on this would be a great help…

Thanks

Please notethat the HTTP response code is always 200 unless the SmartREST endpoint is not available.

Response templates

Response templates have the following syntax:

11,<ID>,<BASE>,<COND>,<VALUE>[,<VALUE>]

Where:

  • <ID> is the message identifier of the response template.
  • <BASE> is the base JSON path pointing to an object or object list from which the values are extracted.
  • <COND> is a conditional JSON path which gets checked for existance. Only if the path exists, values are extracted.
  • <VALUE> is a JSON path pointing to a value to extract within the base object or object in the base object list. An unlimited number of <VALUE> s can be specified.

https://cumulocity.com/guides/reference/smartrest/