I am attempting to setup a new integration. I am in the process of testing the Authentication. Although I am able to successfully get a response from the auth, I cannot seem to parse the response correctly in order to complete the full test.
I need to complete this before I build the remainder of the Integration.
I have tried the basic forms with limited success. I have switched to CodeMode with varying degrees of results. (i.e. I have received results and errors that change in scope but no result has produced a successful test. )
Contacting Zapier support has led me to the Monitor (which shows my errors in a different screen than before but is somewhat helpful) and various links to generic, unhelpful documentation.
Is there a way to get direct help for building an integration? I’m sure this could be completed in 10 minutes if I had direct help.
Best answer by ZaneView original
Consider hiring a Zapier Expert: https://experts.zapier.com/
Would you mind posting the code for your Token Exchange Request?
However, I am moving quickly - Googling and trying different things - so the code might not match anymore.
Thank you for your reply.
I had a peek at your monitoring logs and saw some complaints about the reference to BaseUrl not being a member of ‘undefined’… indicating something is off with the `.Api` reference.
Something I’d recommend is doing one call to .json, rather than every time you reference a member. I don’t think that’s causing the issue, but it’s going to be a lot more efficient. .json is the same as z.JSON.parse(response.content); It’s parsing the string each time it’s called. (It’s possible that it’s memoized, and that doesn’t matter, but still, I’d be safe and just call it in one place.)
Change this to const result = response.json and remove the subsequent calls to the parser.
Next I’d start dropping z.console.log() statements to verify data is getting parsed correctly and references are right. It looks like the data is coming back from the API ok, but something’s going wrong with that nested object reference.
For instance, z.console.log(result.Api.BaseUrl) and see what you get.
I think this will help you narrow down the source of the issue. I think you’re close to having something working.
You might also post the messages from your monitoring section log entries here as well, so others can help you make sense of the problem.
The integration is actually working now. I haven’t polished the code yet as you suggested, but the ultimate result is the same. I was missing the ‘json’ object reference on all of my previous attempts and didn’t know where to find the console output. Once I located that, I saw the missing reference and, what-do-ya-know, it worked! =)
I really appreciate your help!