I am using the Services (7.x-3.7) module to provide a REST API to our website content. However I have a problem with returning images. I am using Scald (7.x-1.1) to manage our media items. This means that when I attempt to GET a node (example.com/rest/node/25592) I get each field for the node in question nicely wrapped in JSON but for the image instead of an image path and file-name I get the Scald ID as follows:

field_event_image: {
und: [1]
0: {
sid: "15775"

How can a client application reference the image path from the SID? I know I can use example.com/atom/15775 but this gives me back a node page containing the image - in other words it contains the menu and default theme elements so it is not trivial or efficient to retrieve the image path from the source - though it could be done with some client side parsing. What I am looking for is a means to reference the image path directly using the SID. I am trying to keep the number of API calls to a minimum. Alternatively is there some way to configure the Services module to return the image path?

Thanks for your time,


asigrist’s picture

I have a content type with an Entity Reference, and inside THAT referenced entity, there's a Scald image atom. When I do a print_r($vars); in my node template, the only info that's coming back is the sid of the image in the referenced entity (exactly like in James' example above). I would also like to get the path of that image from the sid so I can print the image out to my node template. Thanks!!