Error Code 1001: For input string: "leads" failed to convert to a number | Community
Skip to main content
January 6, 2015
Question

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

  • January 6, 2015
  • 9 replies
  • 4815 views

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

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

9 replies

Valerie_Armstro
Level 9
January 6, 2015
Hi Matt,

Here's a link to the Error Codes for the REST API: http://developers.marketo.com/documentation/rest/error-codes/
January 6, 2015
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 9
January 6, 2015
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?
January 7, 2015
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.
January 7, 2015
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?
January 8, 2015
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-34 Would you paste your response JSON?
January 8, 2015
@Takehiro, thanks for catching the error. I fixed the extra space character on the developer documentation page.
January 15, 2015
@Murtza
Today, I find.
"Example 2 Request" has same error.

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

January 15, 2015
@Takehiro, Thank you! I fixed the error.