Marketo API and Zapier - Receiving 601 codes (Access token invalid) even though I have a valid one. | Community
Skip to main content
New Participant
June 4, 2024
Question

Marketo API and Zapier - Receiving 601 codes (Access token invalid) even though I have a valid one.

  • June 4, 2024
  • 2 replies
  • 2978 views

Hi all,

 

I was wondering if anyone could help me with this.

 

I have Marketo integrated with Zapier with an API Only user. Thing is I want to populate a PMCF from Zapier to Marketo for some webinar runs. While testing it out I've found that it actually worked but now that I'm live with real people, it won't populate that field as I keep receiving 601 codes from the Marketo API.

 

Some stuff worth mentioning:

  • I do have the Identify process on Zapier to grab the access token (putting my client id and client secret keys). This is the URL: XXXXX.mktorest.com/identity/oauth/token?grant_type=client_credentials
  • These are the kind of replies I'm getting from that Identify process:
    • Access Token, Token Type, Expires In and Scope
      • Expires In shows numbers usually on their 3000, meaning I still have that time left before it expires.

Basically I'm getting the access token from Marketo every call, so I think there's no reason why I should be receiving 601.

Later on the POST URL I'd put this: XXXXX.mktorest.com/rest/v1/programs/{program-id}/members.json?access_token={accessToken}

I also have the request headers for content type (application/json) and the Authorization (Bearrer {accessToken}.

 

FYI: I'm also including the token inside the Query Parameter field on Zapier (the dynamic token)

What am I missing?

Thanks

2 replies

SanfordWhiteman
New Participant
June 5, 2024

I have Marketo integrated with Zapier with an API Only user. Thing is I want to populate a PMCF from Zapier to Marketo for some webinar runs. While testing it out I've found that it actually worked but now that I'm live with real people, it won't populate that field as I keep receiving 601 codes from the Marketo API.


If this is happening on every single call, that clearly means you aren’t populating the header correctly in the PMCF POST. However, you haven’t provided enough detail about your config for us to tell you where the problem is. We need complete screenshots of every step.

 


  • These are the kind of replies I'm getting from that Identify process:
    • Access Token, Token Type, Expires In and Scope
      • Expires In shows numbers usually on their 3000, meaning I still have that time left before it expires.

Basically I'm getting the access token from Marketo every call, so I think there's no reason why I should be receiving 601.


No, it’s simply not possible for it always to be 3000+ seconds. The expiry will gradually tick down over the course of an hour. Doesn’t matter how frequently you get the token, you’re still getting the same value with a decreasing expiry until a new token is issued.

 

Furthermore, even if you have 2 seconds left on the /identity call that doesn’t mean the token won’t expire by the time you make the call to /members. It’s perfectly possible for the token to expire in that moment. Since you say you’re always getting a 601, your problems run deeper. But you must expect a 601 to occasionally happen and recover gracefully from it by calling /identity again.  

 

FYI: I'm also including the token inside the Query Parameter field on Zapier (the dynamic token)


Don’t put it in both places, that’s just confusing and you’ll later forget it’s redundant. The only one you need is the Authorization: header.

ChaloAuthor
New Participant
June 5, 2024

Hi,

Thanks @sanfordwhiteman , attaching some screenshots and some bullet points:

  • I don't receive the 601 code in all queries, only in some which makes it irregular.
  • There could be a caveat in which the token would have 1-5 seconds left and so that token would not be valid, but it is not the case in here.

1. Requesting Access Token

 

2. Receiving Access Token

3. Requesting POST PMCF population

4. Receiving 601 with fresh Access Token

  


I don't think its the Authorization header I'm missing since it has already worked with this set up...

SanfordWhiteman
New Participant
June 5, 2024

OK, you now seem to understand the token expiry is not always 3000+ seconds. This is at odds with your first post.

 

There’s still not enough information about your setup. Why does one screenshot say “Request Querystring Access Token” as opposed to “access_token”? You have other mapping info not shown here.

 

In general, you should test request payloads with something like JSBin or ngrok. That’ll show you exactly why Zapier is putting the wrong thing on the wire. Clearly Marketo isn’t doing anything wrong here, you just have Zapier configured incorrectly.

New Participant
June 4, 2024

This may sound silly, but have you tried to disconnect and re-do the integration? I had a similar issue to this with ON24 in the past before they updated how that integration was done. The fix was disconnecting and reconnecting. I haven't integrated Marketo and Zapier specifically but it sounds like that integration may be similar. 

SanfordWhiteman
New Participant
June 5, 2024

@ashleighmo1 wrote:

This may sound silly, but have you tried to disconnect and re-do the integration? I had a similar issue to this with ON24 in the past before they updated how that integration was done. The fix was disconnecting and reconnecting. I haven't integrated Marketo and Zapier specifically but it sounds like that integration is similar. 


It’s really not that kind of integration. This is a bespoke call to get a token and make a POST.

New Participant
June 7, 2024

Ah understood! Thanks for clarifying.