Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2013-02-15T05:01:16Z by SystemAdmin
SystemAdmin
SystemAdmin
197 Posts
ACCEPTED ANSWER

Pinned topic Integer value on adding documents via REST api.

‏2013-02-09T09:54:38Z |
I am a newbie for ICA and using v3 and trying to post a document using REST api like

http://ec2-175-41-xxx-xxx.ap-northeast-1.compute.amazonaws.com:8390/api/v10/admin/documentmethod=addMultiDocs&api_username=xxx&api_password=xxx

But my server complains "{"error":{"code":"FFQEP0011E","message":"FFQEP0011E A specified value 61 of parameter interaction\u002Etwitter ... cannot be converted to String ... " and doesn't add this to my index.

{
"documentId":"510e2678b9eb54e56d3e547e",
"filename":"510e2678b9eb54e56d3e547e",
"documentDate":1351128131000,
"language":"ja",
"format":"text/plain",
"fields":
{"interaction.twitter.links":"http://cameran.in/posts/get/v1/ca6e6549b74d4953eba163a1bf970c01",
"interaction.interaction.source":"iOS",
"interaction.interaction.author.link":"http://twitter.com/sakina_tw",
"interaction.twitter.user.id_str":"223101215",
"interaction.twitter.user.id":"223101215",
"interaction.twitter.user.name":"\u3055\u304d\u306a",
"interaction.language.tag":"ja",
"interaction.interaction.type":"twitter",
"interaction.twitter.user.time_zone":"Tokyo",
"interaction.twitter.user.friends_count":61,
}}

I think the last line is the point mentioned, but this seems to be correct in json.
Cannot the ICA convert 61 to string?

Regards,
Updated on 2013-02-15T05:01:16Z at 2013-02-15T05:01:16Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    197 Posts
    ACCEPTED ANSWER

    Re: Integer value on adding documents via REST api.

    ‏2013-02-15T05:01:16Z  in response to SystemAdmin
    The API expects all input field values as text. Can you try to pass the value as text like "61"?
    ICA will internally convert the text to the integer value if the value goes into an indexer field of numeric type.