# How to see the response status code from the node.js Cumulocity web sdk other than from .core.fetch method

**URL:** <https://community.cumulocity.com/t/how-to-see-the-response-status-code-from-the-node-js-cumulocity-web-sdk-other-than-from-core-fetch-method/12797>\
**Category:** Forum\
**Tags:** app-enablement\
**Created:** [September 30, 2025, 2:41pm UTC](https://community.cumulocity.com/t/how-to-see-the-response-status-code-from-the-node-js-cumulocity-web-sdk-other-than-from-core-fetch-method/12797 "2025-09-30T14:41:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kent\_Talbert](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/kent_talbert/32/18620_2.png) [@Kent\_Talbert](https://community.cumulocity.com/u/Kent_Talbert)\
**Post date:** [September 30, 2025, 2:41pm UTC](https://community.cumulocity.com/t/how-to-see-the-response-status-code-from-the-node-js-cumulocity-web-sdk-other-than-from-core-fetch-method/12797/1 "2025-09-30T14:41:16Z")

</div>

I can’t seem to see the response status code for calls made to Cumulocity when carrying out a number of operations such as creating a measurement, alarm, event and updating an inventory managed object.

For example, to create a measurement, I have written the following:

`const { data, res } = await c8yClients.measurement.create(measurementBody);`

However when I observe the data and res values from a successful call, I am unable to obtain the status code `201` as defined in the API documentation here: [Cumulocity - OpenAPI](https://cumulocity.com/api/core/#operation/postMeasurementCollectionResource)

I know that we can obtain the status code when using the .core.fetch method in the web sdk as follows:

`const res = await c8yClients.core.fetch(URL,...)`

But as you can see, it is using the .core.fetch. of the web sdk, for which I can obtain the status in the response via `res.status`. Is this the only way to get the response status code?

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [September 30, 2025, 8:14pm UTC](https://community.cumulocity.com/t/how-to-see-the-response-status-code-from-the-node-js-cumulocity-web-sdk-other-than-from-core-fetch-method/12797/2 "2025-09-30T20:14:07Z")

</div>

I just tried this out myself and I can get the `res.status` from the `client.measurement.create()` function returns the HTTP status code of the API request.

Maybe you’re running into some other issue with the code.

Below is a snippet that I used:

```auto
async function main() {
  const auth = new BearerAuth(process.env["C8Y_TOKEN"]);
  let baseUrl = process.env["C8Y_HOST"];
  if (!baseUrl?.startsWith("http://") && !baseUrl?.startsWith("https://")) {
    baseUrl = `https://${baseUrl}`;
  }
  const client = new Client(auth, baseUrl);
  const mandantoryObject = {
    sourceId: 3449597721,
    fragment: { series: { unit: "%", value: 51 } }
  };
  const { data, res } = await client.measurement.create(mandantoryObject);
  console.log("response", {status: res.status});
}
(async () => {
  await main();
})();

```

**Output**

```auto
response { status: 201 }

```

---

<div class="post-metadata">

**Author:** ![Kent\_Talbert](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/kent_talbert/32/18620_2.png) [@Kent\_Talbert](https://community.cumulocity.com/u/Kent_Talbert)\
**Post date:** [October 1, 2025, 1:17pm UTC](https://community.cumulocity.com/t/how-to-see-the-response-status-code-from-the-node-js-cumulocity-web-sdk-other-than-from-core-fetch-method/12797/3 "2025-10-01T13:17:43Z")

</div>

Thanks Reuben. You example helped!
