Import Assets from external source via iHub

Import Assets from external source via iHub

Latest response way

iHub provide a way to feed in any rest data to Assets, even paginated pages by utilizing the log url

https://{{baseUrl}}/rest/restfulintegrator/1.0/logs/application/{{iHubAppId}}/latestresponse

id is found in the URL as id= parameter. In the above picture it is 22.

 

Asset import

Enter the url to the iHub log to fetch the data from the import.

It will concatenate any paginated response to a flat array of items.

Data report way

What if the response is in a JSON structure and not an array?

Lets say a page from the response looks like this

page=1

{ "myArray"[{ page 1 items}] }

page=2

{ "myArray"[{ page 2 items}] }

Then using the https://{{baseUrl}}/rest/restfulintegrator/1.0/logs/application/{{iHubAppId}}/latestresponse will yield a combined result like this

[ { "myArray"[{ page 1 items}] }, { "myArray"[{ page 2 items}] } ]

That is not what you want, since you would like to get the total array of myArray.

To do this use the data report url

https://{{baseUrl}}/rest/restfulintegrator/1.0/data/application/{{iHubAppId}}?path=$.myArray

the difference is the 1.0/data/application/{{iHubAppId}}?path=$.myArray

data = data resource

path = JSON path to array

Example

https://{{baseUrl}}/rest/restfulintegrator/1.0/data/application/{{iHubAppId}}?path=$.myArray

yields

[ { "myArray"[{ page 1 items}] }, { "myArray"[{ page 2 items}] } ]