SOLVED

Receiving 601 Error Code When Trying to Authenticate to Marketo Web Service in Medallia

Go to solution
GThomson
Level 1

Receiving 601 Error Code When Trying to Authenticate to Marketo Web Service in Medallia

Hello,

I am currently working on a project where we are attempting to integrate Marketo with Medallia (I am configuring this integration on the Medallia side and have minimal experience with Marketo). The way this integration works is that Leads and associated data fields are sent in a sample file that is processed in Medallia and Medallia generates survey links that are sent back to Marketo. So far, we have been able to successfully send a Sample File from Marketo to Medallia, but sending survey link data back to Marketo has been challenging.

The Marketo team that I'm working with has configured a web service and sent us a Client ID and Client Secret that we are using to authenticate to the Marketo identity server and subsequently submit an HTTP POST request to the web service. Medallia has a functionality where I am able to test logging in to the identity server using the OAuth credentials that I was given by the Marketo team (I'm assuming this functionality works by testing the ability to retrieve an access token with cURL commands) and I'm able to do so successfully. However, when I actually try to execute a POST request to Marketo, I receive a 601 error from Marketo in the response.

Our Medallia setup is configured to authenticate to Marketo with the following information (any client specific/senstive information I'm redacting and note that the <<>> is not actually contained in any of our information that we are sending to Marketo):

For authenticating:

Login URL: https://<<token server URL>>.mktorest.com/identity/oauth/token

Login Headers:

  • client_id: <<client ID provided to us>>
  • client_secret: <<client secret provided to us>>
  • grant_type: client_credentials

For making the POST request:

Request URL: https://<<endpoint URL>>mktorest.com/rest/v1/leads.json?fields=<<comma separated list of Marketo IDs of fields we are sending over>>

Request Method: POST

Request Headers:

  • Authorization: Bearer <<token>> (whatever token we receive from the login will be what is piped in for <<token>>)
  • Accept-Encoding: gzip, deflate
  • Content-Type: application/json; charset=utf-8

Content: We have a JSON payload that is being sent over with each request.

Does anyone have some insights regarding why I may be receiving the 601 error (issues with Medallia configuration and how we're making the request? Potential issues with the Marketo configuration that I can communicate to the Marketo team?)? Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Receiving 601 Error Code When Trying to Authenticate to Marketo Web Service in Medallia

A Sync Lead request can't be that simple, it looks like this:

{
   "action" : "updateOnly",
   "lookupField" : "id",
   "input" : [
      {
         "id" : "293746184",
         "zCSMedalliaURL" : "survey.medallia.com/?<<alphanumeric characters>>",
         "zCSMedalliaOptOutURL" : "survey.medallia.com/?<<alphanumeric characters>>&reject=yes"
      }
   ]
}

View solution in original post

9 REPLIES 9
SanfordWhiteman
Level 10 - Community Moderator

Re: Receiving 601 Error Code When Trying to Authenticate to Marketo Web Service in Medallia

The fields query param isn't relevant to this POST request. But that's not causing your error.

 

I suspect the way you're creating the auth header is actually off, like you're adding extra whitespace or there's some variable scope issue that makes the access_token empty. Would have to see an actual request.

 


... where I am able to test logging in to the identity server using the OAuth credentials that I was given by the Marketo team (I'm assuming this functionality works by testing the ability to retrieve an access token with cURL commands) and I'm able to do so successfully.

Hmm, wouldn't assume a server is using a particular HTTP library unless you're basing that on something in particular!

 

GThomson
Level 1

Re: Receiving 601 Error Code When Trying to Authenticate to Marketo Web Service in Medallia

Hi Sanford,

Thanks for your help, I really appreciate it and it finally feels like things are starting to head in the right direction.

I was able to rework how I have things set up in Medallia to submit the HTTP POST request with JavaScript headers to pass the token and it seems like I'm getting closer. With this set up, I can see that Medallia submitted a log in request to Marketo, Marketo responded with an access token (which I didn't see previously and may shed some light on why I was receiving the 601 error), and then Medallia submitted the HTTP POST Request.

This time, Marketo responded with a 609 error with the message "Invalid JSON. Cannot deserialize instance of 'com.marketo.mapi.webapp.entities.json.SyncLeadRequest' out of START_ARRAY token\n at [Source: (PushbackInputStream); line: 1, column: 1]". Do you have any insights regarding why I may be receiving this error now?

SanfordWhiteman
Level 10 - Community Moderator

Re: Receiving 601 Error Code When Trying to Authenticate to Marketo Web Service in Medallia


This time, Marketo responded with a 609 error with the message "Invalid JSON. Cannot deserialize instance of 'com.marketo.mapi.webapp.entities.json.SyncLeadRequest' out of START_ARRAY token\n at [Source: (PushbackInputStream); line: 1, column: 1]". Do you have any insights regarding why I may be receiving this error now?

What's the exact JSON payload that's being sent? That error is always accurate in my experience, that is, it's bad JSON.

GThomson
Level 1

Re: Receiving 601 Error Code When Trying to Authenticate to Marketo Web Service in Medallia

This is an example of a payload included in a request we sent over for which we received a 609 error. I'm redacting the exact survey URLs since this is a public forum and if someone were to complete the surveys the response would be recorded in our instance:

[{"id":"293746184","zCSMedalliaURL":"survey.medallia.com/?<<alphanumeric characters>>","zCSMedalliaOptOutURL":"survey.medallia.com/?<<alphanumeric characters>>&reject=yes"}]

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Receiving 601 Error Code When Trying to Authenticate to Marketo Web Service in Medallia

A Sync Lead request can't be that simple, it looks like this:

{
   "action" : "updateOnly",
   "lookupField" : "id",
   "input" : [
      {
         "id" : "293746184",
         "zCSMedalliaURL" : "survey.medallia.com/?<<alphanumeric characters>>",
         "zCSMedalliaOptOutURL" : "survey.medallia.com/?<<alphanumeric characters>>&reject=yes"
      }
   ]
}
GThomson
Level 1

Re: Receiving 601 Error Code When Trying to Authenticate to Marketo Web Service in Medallia

Sent over a POST request from Medallia with the payload reformatted and the Marketo team just confirmed that Leads successfully updated with Medallia URLs! Thanks again for your help Sanford I really appreciate it!

SanfordWhiteman
Level 10 - Community Moderator

Re: Receiving 601 Error Code When Trying to Authenticate to Marketo Web Service in Medallia

Sure thing.
GThomson
Level 1

Re: Receiving 601 Error Code When Trying to Authenticate to Marketo Web Service in Medallia

Hi Sanford - today I encountered another issue regarding authentication to the Marketo Web Service that I mentioned in this post, and I wanted to follow up here to see if you had any insights regarding potential workarounds from a Marketo configuration perspective.

Today, Medallia attempted to make ~150 POST requests to Marketo to send survey URLs for which we received 601 and 602 errors. It appears that Medallia did not attempt to retrieve an access token from Marketo during its first POST request, which caused all subsequent requests to fail.

Through consulting Medallia support, it appears that Medallia's APIs will only attempt to retrieve a new access token if they receive a 401 error in response to a request, which is why I'm concerned that the 601 and 602 errors that we receive from Marketo are not signaling to Medallia that it needs to acquire a new access token. I'm currently working with Medallia to see if we can develop a feasible workaround, but I also wanted to reach out to you to see if it's possible from a Marketo configuration perspective to configure a web service so that it returns a 401 error in its response if it receives an invalid/expired token? Through consulting Marketo's developer docs I see it is possible for identity endpoints in Marketo to return a 401 Unauthorized error, but it appears that it mostly returns that code in response to invalid credentials.

SanfordWhiteman
Level 10 - Community Moderator

Re: Receiving 601 Error Code When Trying to Authenticate to Marketo Web Service in Medallia


Through consulting Medallia support, it appears that Medallia's APIs will only attempt to retrieve a new access token if they receive a 401 error in response to a request, which is why I'm concerned that the 601 and 602 errors that we receive from Marketo are not signaling to Medallia that it needs to acquire a new access token.

Well, that's sure broken on Medallia's side. The HTTP 200 with an inner (JSON) "code" : "601" is the way Marketo always signals an expired token.

 


 ...to see if it's possible from a Marketo configuration perspective to configure a web service so that it returns a 401 error in its response if it receives an invalid/expired token?

Not with Marketo alone, no. Only if you built an intermediate gateway that transformed responses so HTTP 200 + inner "601" turned into a 401. You could do this with AWS API Gateway, for example.