pagingtoken API gives error even when using one of the supported date formats | Community
Skip to main content
June 6, 2016
Solved

pagingtoken API gives error even when using one of the supported date formats

  • June 6, 2016
  • 2 replies
  • 2687 views

Hi There,

We are using Marketo Rest API to pull data from Marketo. For extracting activities we have to first generate a token(nextpagetoken) which can be used to fetch Activity from the date that user has provided.

For generating initial token as per marketo documentation we have to use pagingtoken API? . As per documentation this API supports three date formats for sinceDatetime parameters using any of these three formats we were able to generate paging token using either of the below sample API call:

074-uin-407.mktorest.com/rest/v1/activities/pagingtoken.json?access_token=xxxx&sinceDatetime=2013-05-22T11:03:26+05:30

074-uin-407.mktorest.com/rest/v1/activities/pagingtoken.json?access_token=xxxx&sinceDatetime=2013-05-22T11:03+05:30

074-uin-407.mktorest.com/rest/v1/activities/pagingtoken.json?access_token=xxxx&sinceDatetime=2013-05-22

But suddenly it started giving below error for 2013-05-22T11:03:26+05:30 and 2013-05-22T11:03+05:30 date formats and it only works with 2013-05-22 date format.

{

  "requestId": "a1c9#15524613da4",

  "success": false,

  "errors": [

    {

      "code": "1001",

      "message": "Invalid value '2013-05-22T11:03:26 05:30'. Required of type 'Date'"

    }

  ]

}

Can someone please look into this issue and let us know why it suddenly stopped working?

Thanks!!

Message was edited by: Anil Upadhyay

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Not a bug, standard URL encoding requirement.  Encode + to %2B:

sinceDatetime=2016-03-01T00:00:00%2B05:00

2 replies

June 6, 2016

Hi Anil

I just remembered.

In this case, plus timezone does not supported.

I think it's bug.

For example

Success

000-xxx-999.mktorest.com/rest/v1/activities/pagingtoken.json?sinceDatetime=2013-05-22T11:03-09:00

Failed

000-xxx-999.mktorest.com/rest/v1/activities/pagingtoken.json?sinceDatetime=2013-05-22T11:03+09:00

{"requestId":"17cc9#155247d9848","success":false,"errors":[{"code":"1001","message":"Invalid value '2013-05-22T11:03 09:00'. Required of type 'Date'"}]}

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
June 6, 2016

Not a bug, standard URL encoding requirement.  Encode + to %2B:

sinceDatetime=2016-03-01T00:00:00%2B05:00

June 6, 2016

Thank you @Sanford Whiteman​

I forgot encoding.

I was confused because the "hh:mm:ss+09:00" format was working.

I think Anil's problem is same as me

SanfordWhiteman
New Participant
June 6, 2016

Are you actually including the trailing question mark?  That is certainly not allowed in the date format.  This is standard ISO formatting, nothing special to Marketo.

EDIT: I didn't catch until a couple of posts later that Anil wasn't URL-encoding the plus sign.

June 6, 2016

No We are not appending ? at end . Updated the description.