Marketo REST API token keeps expiring

marketo access token invalid
marketo client id and client secret
refresh token marketo
marketo api information
marketo api status
marketo webhook authentication
marketo api python
marketo api partition

I followed the Quick Start Guide on Marketo's site for their REST API. This went well. I was able to get a successful response from their website.

Request:

curl https://ABC-DEF-123.mktorest.com/rest/v1/lists.json?access_token=123:ab

Response:

{"requestId":"123#abcf7aff","result":[],"success":true}

However, when I tried the same request the next day, I received:

{"requestId":"123#abc6731ab6f","success":false,"errors":[{"code":"601","message":"Access token invalid"}]}

I logged into the Marketo admin and noticed that the token I copied and pasted out of the dialog box was different. I tried this new one and it worked.

(This is taken from the guide)

I came across another guide on their site that describes a different authentication process. Marketo Authentication Guide

This guide mentions the token that is returned from the API endpoint has an expiration so I suspect that all Marketo tokens expire (or I need to disable this). However, I have not been able to successfully make requests to this endpoint with my client ID and client secret.

Request:

curl https://ABC-DEF-123.mktorest.com/identity/oauth/token?grant_type=client_credentials&client_id=ACLIENTID&client_secret=ACLIENTSECRET

Response:

{"error":"unauthorized","error_description":"An Authentication object was not found in the SecurityContext"}

Any help in the right direction would be appreciated. Thanks in advance.


REST API tokens expire. So you typically will need to request a token for each session.

from your specific installed URL, like: MARKETOURL/identity/oauth/tokengrant_type=client_credentials&client_id=abc&client_secret=xyz

Which will result in (example):

{
"access_token": "1234",
"token_type": "bearer",
"expires_in": 3599,
"scope": "email@email.com"
}

You will need to start out your sessions with this request to do subsequent calls. I have code that runs this first and then requests a new token if it expires. The expires_in field is in seconds.

Source: http://developers.marketo.com/documentation/rest/authentication/

Authentication, If the token is expired, then renew it by calling Identity endpoint. This will help ensure that your REST call never fails due to an expired token. If an invalid token is used to authenticate a REST call, a 601 error code will be returned. Prior to making any REST call, you should check the validity of the token based on its remaining lifespan.  If the token is expired, then renew it by calling Identity  endpoint.  This will help ensure that your REST call never fails due to an expired token.


I was not able to figure out why my curl requests were failing, but I was able to successfully call the Marketo API with mrkt, a Ruby Gem for Marketo.

I've looked through the logs of what the gem is generating for requests and they appear to be exactly the same. But at least I now successfully calling Marketo.

Solved: Re: REST API - Invalid token - Marketing Nation, If you generate token from API via auth endpoint, it expires in 24 hours Auth dabbling with Marketo REST API and I keep running into invalid token issue. Marketo exposes a REST API which allows for remote execution of many of the system’s capabilities. From creating programs to bulk lead import, there are a large number of options which allow fine-grained control of a Marketo instance. These APIs generally fall into two broad categories: Lead Database, and Asset. Lead Database APIs allow for … Continue reading "REST API"


You need to use following sequences.

grant_type=  client_credentials
client_id =you will get Marketo admin where you generate token
client_secret=you will get Marketo admin where you generate token
Content-Type: application/x-www-form-urlencoded;charset=UTF-8



GET <Identity URL>/oauth/token?grant_type=client_credentials&client_id=<Client Id>&client_secret=<Client Secret>

Marketo REST API token keeps expiring, REST API tokens expire. So you typically will need to request a token for each session. You will need to start out your sessions with this request to do subsequent calls. I have code that runs this first and then requests a new token if it expires. In terms of the authentication model, the REST API has an authentication model that uses an expiring token. Our REST API also provides access to Marketo assets. Q: What features are available in the REST API that are not available in the SOAP API? A: List of lists API, check if lead is a member of list API, remove a lead from a list API, Usage


Your first call failed because your token expires every hour currently, according to Marketo's docs.

Your curl call to get a new token failed because curl (or something) was stripping off the auth arguments. Try wrapping the url in quotes.

curl "https://ABC-DEF-123.mktorest.com/identity/oauth/token?grant_type=client_credentials&client_id=ACLIENTID&client_secret=ACLIENTSECRET"

You can get more information about what curl is sending with the -v flag. Running this would have given you enough information to at least know that your entire url wasn't being passed down to the request.

curl -v https://ABC-DEF-123.mktorest.com/identity/oauth/token?grant_type=client_credentials&client_id=ACLIENTID&client_secret=ACLIENTSECRET

Marketo REST API token keeps expiring - marketo - html, Marketo Authentication Guide This guide mentions the token that is returned from the API endpoint has an expiration so I suspect that all Marketo tokens expire  It exposes the getToken method which tests whether the currently stored token is null or expired, and then returns either the existing token, or makes a new authentication request then returns the new token from the “access_token” member of the JSON response.


Authentication types in API Manager, Find out more about the authentication types used in the API Commerce Cloud Modern commerce platform · Marketo Engage B2B engagement marketing When the token expires, applications request for a new token and is granted one. Keep the application private, otherwise the credentials can be  We are integrating with Squiz Matrix and trying to set up Oauth/Oauth2 so we can set up the following: "When the asset is accessed again and this token is still valid, the stored token will be reused. If the token has expired, a new access token will be retrieved by either re-authentication or by using an available refresh token.


Refresh Tokens, Typically, a user needs a new Access Token when gaining access to a resource for the first time, or after the previous Access Token granted to them expires. Token Endpoint Reference Tokens in Marketo are special strings similar to shortcodes which are replaced by a separate piece of data at run time. There are several types of tokens available in Marketo, but only My Tokens can be edited via the API.


Marketo Integration Guide, With the Marketo + PagerDuty integration, users can get notified in real time REST API is possible, keep in mind that the API access token expires every hour. Token Types. There are two related, but distinct, types of paging tokens which Marketo provides: Date-Based; Position-Based; Date-Based. The first is a paging token which represents a date. These are used to retrieve activities, data value changes, and deleted leads which occurred after the date represented by the paging token.