# Cumulocity request/response template testing using Postman

**URL:** <https://community.cumulocity.com/t/cumulocity-request-response-template-testing-using-postman/7296>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [May 14, 2020, 12:54pm UTC](https://community.cumulocity.com/t/cumulocity-request-response-template-testing-using-postman/7296 "2020-05-14T12:54:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mardi](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@mardi](https://community.cumulocity.com/u/mardi)\
**Post date:** [May 14, 2020, 12:54pm UTC](https://community.cumulocity.com/t/cumulocity-request-response-template-testing-using-postman/7296/1 "2020-05-14T12:54:41Z")

</div>

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 :

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

(generated X-ID :2714)

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

```auto
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:

```auto
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

---

<div class="post-metadata">

**Author:** ![Gyan\_Awasthi1](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@Gyan\_Awasthi1](https://community.cumulocity.com/u/Gyan_Awasthi1)\
**Post date:** [June 19, 2020, 10:20am UTC](https://community.cumulocity.com/t/cumulocity-request-response-template-testing-using-postman/7296/2 "2020-06-19T10:20:05Z")

</div>

Please notethat the _HTTP_ response code is always `200` unless the _SmartREST_ endpoint is not available.

#### Response templates

Response templates have the following syntax:

```auto
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.

> **[Cumulocity documentation](https://cumulocity.com/docs/)**
>
> This documentation offers comprehensive information on the Cumulocity platform both from a user and from a developer perspective. It reflects the latest state of the Cumulocity platform and is continuously updated to align with recent software...

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [April 2, 2021, 3:44pm UTC](https://community.cumulocity.com/t/cumulocity-request-response-template-testing-using-postman/7296/3 "2021-04-02T15:44:41Z")

</div>

Closed on April 2, 2021, 3:44pm UTC


