Re: Error Code 1001: For input string: "leads" failed to convert to a number

Anonymous
Not applicable

Trying to test the REST API but running into this error using the first example on Create/Update Lead page.

What does the error code mean?

Thanks,

Matt

Tags (1)
9 REPLIES 9
Anonymous
Not applicable
@Takehiro, Thank you! I fixed the error.
Anonymous
Not applicable
@Murtza
Today, I find.
"Example 2 Request" has same error.

"email":"kjashaedd- 1@klooblept.com",

Anonymous
Not applicable
@Takehiro, thanks for catching the error. I fixed the extra space character on the developer documentation page.
Anonymous
Not applicable
Hi
@Murtza
I find sample bug.
First lead data include space char in email address. 
"email":"kjashaedd- 1@klooblept.com",
But error message is 
{"code":"1003","message":"Invalid value for field 'email'"},
Not 1001.
I deleted a space char and it worked fine.
Adding information: I tried wrong partion case but error message is
{"code":"1008","message":"Access denied to partition 'name'"}

@Matt Would you paste your response JSON?
Anonymous
Not applicable
Removing the quotes didn't work nor did removing postal code altogether. I'm beginning to wonder if it's just the Fiddler doesn't actually like my input. Any thoughts on what format I should use for Fiddler?
Anonymous
Not applicable
This might be an error in the docs. Can you retry your request without "" around values for postalCode? Or alternatively, try this call without include the postalCode field and its data?

I can verify the Ruby sample code works for this API endpoint. When I created it, I did not use postalCode, so that is why I am guessing where the error is.
Valerie_Armstro
Level 10 - Champion Alumni
I don't have too much knowledge on APIs, but there looks to be an extra space in the first email value (between the - and the 1)  Maybe that is what is throwing the error since the email address field can't have spaces?
Anonymous
Not applicable
Thanks, Val. That links helps... now my next question: Why would the sample code fail? I'm assuiming that the sample code wouldn't have a type mismatch in it.


   "action":"createOnly",
   "lookupField":"email",
   "partitionName":"name",
   "input":[ 
      { 
         "email":"kjashaedd- 1@klooblept.com",
         "firstName":"Kataldar-1",
         "postalCode":"04828"
      },
      { 
         "email":"kjashaedd-2@klooblept.com",
         "firstName":"Kataldar-2",
         "postalCode":"04828"
      },
      { 
         "email":"kjashaedd-3@klooblept.com",
         "firstName":"Kataldar-3",
         "postalCode":"04828"
      }
   ]
}
Valerie_Armstro
Level 10 - Champion Alumni
Hi Matt,

Here's a link to the Error Codes for the REST API: http://developers.marketo.com/documentation/rest/error-codes/