I’m a bit new to this and working with an API that requires a separate username/password login process in order to establish a session ID as a keytoken for use in authentication with all other API calls. Each session only lasts 60 minutes after the last API call.
I know I could use a scheduled trigger to automate the login process first, but my preference would be to only run the zap when a new record is found in the data I would like to poll.
Is this a common issue or something that is easily handled within the trigger fields that I’m not seeing? Thanks!
Best answer by ikbelkirasanView original
What app API are you using?
Does the app offer Webhooks? (This would trigger the Zap each time there is a new record, rather than having to poll the app API.)
Here’s a help article about Webhooks Retrieve Poll: https://zapier.com/help/doc/how-get-started-webhooks-zapier#using-the-retrieve-poll-trigger-option
@Troy Tessalone - I was attempting to use the Zapier Webhooks app to Retrieve Poll from a URL I don’t have the option to get the data sent to a Zapier webhook for use with “Catch hook” triggers.
Thanks for the article link - found the limitation here:
This trigger is one that only supports basic authentication - should you need to create your own polling triggers for APIs that offer advanced forms of authentication, you should create your own private application on the Zapier platform.
I guess it makes sense to dive into that and see what I can do. Thanks so much!
SO I got pretty far into the “session authentication” portion of building my own private app except for the returning of the session token.
Here is the code that Zapier provides:
Here’s the response from the logs - you’ll see that the login is successful and the ‘SessionID’ is provided in the output but I have no clue how to parse the sessionID and get it into the ‘SessionKey’ using the default code above.
Now onto the trigger - On step 1 “Configure API Request” I have the necessary headers, params, and body - also figured out how to parse the response content from another article:
Then I go to the next step - Test your API request, and I’m getting a response that the SessionID is missing.
Oddly, looking at the ‘HTTP’ logs, I see a successful authentication step and another step showing a successful response with the array I’m looking for. Why would I be getting this missing session ID error if I’m seeing a valid response in the logs?
Here is a sample of the results:
Here is my code right now:
I’m so close! So appreciative of your support here.
One last thing, can you update the best answer selection because it seems that you chose the wrong one :)