AnsweredAssumed Answered

FileMaker 17 Data API - Pulling content from containers to use elsewhere

Question asked by caston on Aug 31, 2018
Latest reply on Nov 2, 2018 by caston

Hello all,


I am working with a NodeJs server and using the npm package "request" to handle my calls.

 

I have been assigned the task of pulling post content from our FileMaker 17 server through the data api and publishing a post on Facebook. I am retrieving my layout and record without issue. The issue comes with the url that I get from the container on the layout:

 

"https://smrtsocial.co/Streaming_SSL/MainDB/88CC74E900ACE8D1ED28B95C948EBBC46AA7263F0679461F06F76668778A984D.jpg?RCType=EmbeddedRCFileProcessor"

 

I am at a complete loss for what to do with this url. Entering it into a browser gives me a 401 - Unauthorized error. Sending a GET request to it from my server returns the same. I have tried a dozen things and am still beating my head against this same 401 - Unauthorized brick wall.

 

Through some research, I found an article that mentioned needing a SessionToken (stored as a cookie). The article failed to mention where that token came from. In fact, in a comment to that article, someone shared code that called the url with a new cookieJar and had no issue retrieving the image. My call to get the image from the url does have a token set upon return: a __cfduid cookie.

 

I also found an article on the previous version of the data api. The video in the article showed the result of pulling down a container. The url he was given from the api was nearly identical to the one I received save for one difference: his had a SessionToken query parameter. He was able to enter the url straight into the browser and view the image.

 

So, if I am right about needing a token, where do I get it?

Outcomes