SOLVED

Re: REST API: Not recognizing program id starts with number 0

Go to solution
Anonymous
Not applicable

REST API: Not recognizing program id starts with number 0

Hi,

I'm trying to get the leads by program id. Most of our programs IDs are starting with number 0 (zero)..

example 0816

REST url: https://123-wzl-123.mktorest.com:443/rest/v1/leads/programs/0816.json?access_token=123

Response:

{

    "requestId": "16286#15f9fc20164",

    "success": false,

    "errors": [

        {

            "code": "1013",

            "message": "Program '816' not found"

        }

    ]

}

Looks like the api removing the 0 from the Program id.

Can anyone please help me on this.

Thanks.

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Mark_Price
Level 7

Re: REST API: Not recognizing program id starts with number 0

Hi Rajesh,

Where did the program Id come from?  Was it provided by someone else? 


An easy way to get a program id for a simple test is from the from the address bar when logged into Marketo. 

Navigate to the program and notice the address bar. A link like this will appear:   https://app-***marketo.com/#PG1396A1  <-   It's a link for program id: 1396

To test, maybe try a known good value for program id with the above method.

View solution in original post

10 REPLIES 10
SanfordWhiteman
Level 10 - Community Moderator

Re: REST API: Not recognizing program id starts with number 0

Where are you retrieving the Program Id that is a zero-padded string?

Anonymous
Not applicable

Re: REST API: Not recognizing program id starts with number 0

Its a QA env

SanfordWhiteman
Level 10 - Community Moderator

Re: REST API: Not recognizing program id starts with number 0

That doesn't answer the question... I'm asking what endpoint you're querying that is returning string IDs rather than integers in the first place. Why do you think this Program's underlying ID is "0816"?

Mark_Price
Level 7

Re: REST API: Not recognizing program id starts with number 0

Hi Rajesh,

Where did the program Id come from?  Was it provided by someone else? 


An easy way to get a program id for a simple test is from the from the address bar when logged into Marketo. 

Navigate to the program and notice the address bar. A link like this will appear:   https://app-***marketo.com/#PG1396A1  <-   It's a link for program id: 1396

To test, maybe try a known good value for program id with the above method.

SanfordWhiteman
Level 10 - Community Moderator

Re: REST API: Not recognizing program id starts with number 0

An easy way to get a program id for a simple test is from the from the address bar when logged into Marketo

Not always though. There are exceptional cases where the URL hash doesn't represent the real REST ID, but rather a UI-only ID.

Mark_Price
Level 7

Re: REST API: Not recognizing program id starts with number 0

Good to know!       Haven't run into it yet but maybe will switch to using query byName or something else to find id for testing.

SanfordWhiteman
Level 10 - Community Moderator

Re: REST API: Not recognizing program id starts with number 0

Discovered it the hard way.

Anonymous
Not applicable

Re: REST API: Not recognizing program id starts with number 0

Sorry my bad, I was looking for the ID somewhere else. Thank for the replies.

But this is a bug, if there is any ID that starts with 0.

Thanks,

Bala

SanfordWhiteman
Level 10 - Community Moderator

Re: REST API: Not recognizing program id starts with number 0

Integer.toString() can't start with "0".