1

I'm fairly new to SharePoint and have been wrestling with this particular problem for some time now. Whenever I try using the REST API for a calendar list using the following url

/<my_domain>//_api/web/lists/getbytitle('Class%20Sessions')/items?

it fails and returns the following:

 <m:error
 xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
 <m:code>-1, System.FormatException</m:code> <m:message
 xml:lang="en-US">Input string was not in a correct format.</m:message>
 </m:error>

The same format for all the rest of my lists that are non calendar type work just fine. I know I am not misspelling the list name and it does exist. I feel that there is something fundamentally wrong. Is there something special that I need to do for the calendar type list?

Any help to point me to the right direction will be greatly appreciated.

3
  • Have you tried /_api/web/lists(guid'list GUID')? Just for testing
    – cubanGuy
    Feb 24, 2015 at 17:58
  • If he title of the list contains a space you can leave it as ('Class Sessions') and will work. Feb 25, 2015 at 15:12
  • Awesome! It work to perfection. Although I do wonder why it was a problem in the first place? Feb 26, 2015 at 13:41

3 Answers 3

1

I faced this scenario, and the problem was related to a incorrect Field definition.

0
1

Late reply, but still may be useful for someone:

I've noticed %20 in input string - please be aware that SP marks spaces as 'x0020', so 'Class_x0020_Sessions' should work.

TIP: Underscore is marked as 'x005f'

0

I still don't know what the problem was exactly but Cubanguy's suggestion worked just fine. Instead of using the getByTitle('ClassS')/fields read operation I used _api/web/lists(guid'<list id>').

It was a simple fix to an odd problem. Thank you!

1
  • I am facing the same issue, while i Use rest to get a list data in my client web-part / App-Part in SP2013 i get the same error. Sep 21, 2015 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.