Content API - Children related asset URL


#1

**Matrix Version:6.20

Good afternoon,
I have been working with the Content API (which is awesome by the way), but I am having difficulty trying to get the URL to an image asset, as part of a child schema. I suspect that it has to do with my squiz keywords not being correct.

Using content API to compiled, and REST to manipulate in squiz.

In postman:
URL__api/assets/ASSETID/children?limit=5000&data=metadata,attributes

Which is returning

“metadata” : {
“image”: 12345 (which is the ID of the image)
}

Using the REST resource, what is the best approach for obtaining the URL for the image ID?

Am trying to use with little success:
globals_asset_children:12345^json_decode^as_asset:asset_url^index:1

Thank you.


#2

Resolved: Completely forgot about the ‘replace keywords in output’ REST option.


(Harinder Singh) #3

Hi, Could you please explain how to pass an access token in a REST API request? I’m trying to achieve a similar behavior and would like to know how to do it.


#4

You may have figured this one out already, but you first need to create your token. Such as an 0Auth 2.0 2-legged token.

You can then pass this through to a Squiz REST asset, under authentication type.

If you are running into issues, first check that your access token works correctly by previewing the access token. By previewing, it should set a new token against the session. You can see if the token has been added after previewing by going back to the details of the token, and at the bottom of the screen, you should see your new token along with expiration.

I use postman to ensure everything works correctly, before adding it into Squiz to eliminate any issues which may be occurring outside of the CMS