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:
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?