# CData REST RSD – How to Pass Dynamic Bearer Token and Parse JSON Array Response with jsonproviderGet

**URL:** <https://community.cdata.com/t/cdata-rest-rsd-how-to-pass-dynamic-bearer-token-and-parse-json-array-response-with-jsonproviderget/1329>\
**Category:** CData Embed Connectors\
**Tags:** api-integration, question, rest-rsd, oauth-flow, cynet-api, incorta, jsonproviderget, json-parsing, bearer-token\
**Created:** [September 28, 2026, 5:05pm UTC](https://community.cdata.com/t/cdata-rest-rsd-how-to-pass-dynamic-bearer-token-and-parse-json-array-response-with-jsonproviderget/1329 "2026-09-28T17:05:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stalha.tariq](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@stalha.tariq](https://community.cdata.com/u/stalha.tariq)\
**Post date:** [September 28, 2026, 5:05pm UTC](https://community.cdata.com/t/cdata-rest-rsd-how-to-pass-dynamic-bearer-token-and-parse-json-array-response-with-jsonproviderget/1329/1 "2026-09-28T17:05:20Z")

</div>

Hi,

I’m creating a custom CData REST RSD for the Cynet API and consuming it through Incorta.

The RSD performs two calls: first a `POST` to obtain the access token, then a `GET` to the Alerts endpoint using the Bearer token.

The login works and the token is populated (length is 857 characters). I also confirmed that `httpGet` retrieves the raw response body from the Alerts endpoint. However, `jsonproviderGet` returns **0 rows**.

The response from the Alerts endpoint is structured like:

```auto
{ "SyncTimeUtc": "2026-09-28T06:28:02.0628506Z", "Entities": [{ "ClientDbId": 166, "Uniqueness": "...", "IncidentName": "Host Was Not Scanned", "IncidentDescription": "..." }]}

```

Here is the relevant RSD:

```auto
<api:script xmlns:api="http://apiscript.com/ns?v1" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <api:info title="CynetAlerts" desc="Cynet alerts - rolling last 30 days" xmlns:other="http://apiscript.com/ns?v1"> <attr name="ClientDbId" xs:type="long" columnsize="20" readonly="true" other:xPath="/json/Entities/ClientDbId" /> <attr name="Uniqueness" xs:type="string" columnsize="2000" readonly="true" other:xPath="/json/Entities/Uniqueness" /> <!-- additional attributes --> </api:info> <!-- Login configuration --> <api:set attr="loginin.DataModel" value="DOCUMENT" /> <api:set attr="loginin.ConnectionType" value="HTTPS" /> <api:set attr="loginin.URI" value="access_token_uri" /> <api:set attr="loginin.AuthScheme" value="NONE" /> <api:set attr="loginin.ContentType" value="application/json" /> <api:set attr="loginin.EncodePostData" value="false" /> <api:set attr="loginin.XPath" value="/json" /> <api:set attr="loginin.ElementMapPath#1" value="/json/access" /> <api:set attr="loginin.ElementMapName#1" value="access" /> <api:set attr="loginin.data"> { "accessKey": "XXXXX", "secretKey": "XXXXX" } </api:set> <api:set attr="tmp.token" value="" /> <api:set attr="loginin.method" value="POST" /> <api:call op="jsonproviderGet" in="loginin" out="loginout"> <api:set attr="tmp.token" value="[loginout.access]" /> </api:call> <!-- Alerts --> <api:set attr="alertsin.DataModel" value="DOCUMENT" /> <api:set attr="alertsin.ConnectionType" value="HTTPS" /> <api:set attr="alertsin.URI" value="base_uri?LastSeen=2026-09-26%2000:00:00" /> <api:set attr="alertsin.JSONPath" value="$.Entities" /> <api:set attr="alertsin.method" value="GET" /> <api:set attr="alertsin.Header:Name#1" value="Authorization" /> <api:set attr="alertsin.Header:Value#1" value="Bearer [tmp.token]" /> <api:set attr="alertsin.Header:Name#2" value="client_id" /> <api:set attr="alertsin.Header:Value#2" value="XXXXX" /> <api:call op="jsonproviderGet" in="alertsin" out="alertsout"> <api:push /> </api:call></api:script>

```

Could someone advise what is causing `jsonproviderGet` to return zero rows?

Specifically, I would like to confirm:

- Is `alertsin.JSONPath = "$.Entities"` correct when `Entities` is an array?
- Should the `other:xPath` values be `/json/Entities/ClientDbId`, etc., or should they be relative to each entity?
- Should `api:push` explicitly reference `alertsout`?
- Is using `in="alertsin"` with `jsonproviderGet` correct in this structure?

The HTTP GET itself is successful; the issue appears to be the JSON parsing/row generation.

Thanks.

---

<div class="post-metadata">

**Author:** ![Ethem\_Q](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/ethem_q/32/1997_2.png) [@Ethem\_Q](https://community.cdata.com/u/Ethem_Q)\
**Post date:** [September 29, 2026, 10:30pm UTC](https://community.cdata.com/t/cdata-rest-rsd-how-to-pass-dynamic-bearer-token-and-parse-json-array-response-with-jsonproviderget/1329/2 "2026-09-29T22:30:45Z")

</div>

Hi ​ @stalha.tariq ,

I am not seeing any issues with the Alert block so that should be good. For the authentication block, it can be simplified further to get down to a cleaner script but other than that it does look functional. The main issue is the XPath has not been defined correctly. Because for the JSONPath repeat element, that wildcard is \*, whereas the wildcard is % for the column other:xPath values. Can you try making the changes below?

```auto
<api:info title="CynetAlerts" desc="Cynet alerts - rolling last 30 days" xmlns:other="http://apiscript.com/ns?v1"><attr name="ClientDbId" xs:type="int" columnsize="4" precision="11" readonly="false" other:xPath="/json/%/ClientDbId" /><attr name="IncidentDescription" xs:type="string" columnsize="2000" readonly="false" other:xPath="/json/%/IncidentDescription" /><attr name="IncidentName" xs:type="string" columnsize="2000" readonly="false" other:xPath="/json/%/IncidentName" /><attr name="Uniqueness" xs:type="string" columnsize="2000" readonly="false" other:xPath="/json/%/Uniqueness" /></api:info>

```

The JSONPath for the Alerts block can be set as below:

```auto
<api:set attr="JSONPath" value="$.%" />

```

Also, you should indeed include the api:push item=“alertsout”

```auto
 <!-- Fetch the target data --> <api:call op="jsonproviderGet" in="alertsin" out="alertsout">      <api:push item="alertsout" />  </api:call>

```

Kindly give this a try and let me know if this resolves the issue.
