0

Contact post weird response

Hello,


Having a difficulty to submit a post request for creating a contact to:

http://social.yahooapis.com/v1/user/{guid}/contacts

(guid replaced of course and using same process for creating oauth authentication as for all other calls, so I suppose that should work)
... and I'm getting the following weird response:


CODEBOX
<?xml version="1.0" encoding="utf-8"?>
<error xmlns="http://social.yahooapis.com/v1/schema.rng"
xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:uri="http://www.yahooapis.com/v1/errors/404"
yahoo:lang="en-US">
<description>Resource not found</description>
<detail>unknown app:
yahoo:contactsdj0yJmk9N0FmdTN0VDIxdUZWJmQ9WVdrOU1VTmxUR3RXTkRRbWNHbzlNakV4TVRJe
E5qTTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD01OQ--</detail>
</error>


Does anyone have any idea what it means?
Thank you!


P.S. I'm also including the XML that I'm posting, just in case:

CODEBOX
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:contact xmlns:ns2="http://social.yahooapis.com/v1/schema.rng"
xmlns:ns1="http://www.yahooapis.com/v1/base.rng">
<ns2:fields>
<ns2:type>nickname</ns2:type>
<ns2:value>Banana2</ns2:value>
</ns2:fields>
<ns2:fields>
<ns2:type>notes</ns2:type>
<ns2:value>Loooser!</ns2:value>
</ns2:fields>
<ns2:fields>
<ns2:type>name</ns2:type>
<ns2:value>
<ns2:givenName>Test</ns2:givenName>
<ns2:familyName>Contact</ns2:familyName>
</ns2:value>
</ns2:fields>
<ns2:fields>
<ns2:type>email</ns2:type>
<ns2:value>demo@demo1.com</ns2:value>
<ns2:flags>WORK</ns2:flags>
</ns2:fields>
<ns2:fields>
<ns2:type>email</ns2:type>
<ns2:value>something@some.com</ns2:value>
<ns2:flags>WORK</ns2:flags>
</ns2:fields>
<ns2:fields>
<ns2:type>phone</ns2:type>
<ns2:value>234342424</ns2:value>
<ns2:flags>WORK</ns2:flags>
</ns2:fields>
<ns2:fields>
<ns2:type>phone</ns2:type>
<ns2:value>1211 12333</ns2:value>
<ns2:flags>WORK</ns2:flags>
</ns2:fields>
<ns2:fields>
<ns2:type>jobtitle</ns2:type>
<ns2:value>lead idiot</ns2:value>
</ns2:fields>
<ns2:fields>
<ns2:type>company</ns2:type>
<ns2:value>bannerama</ns2:value>
</ns2:fields>
<ns2:categories>
<ns2:name>friend</ns2:name>
</ns2:categories>
</ns2:contact>

6 Replies
  • QUOTE (Aleksandar Pecanov @ Jun 17 2010, 06:10 AM) <{POST_SNAPBACK}>
    ...
    ... and I'm getting the following weird response:

    <?xml version="1.0" encoding="utf-8"?>
    <error xmlns="http://social.yahooapis.com/v1/schema.rng"
    xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:uri="http://www.yahooapis.com/v1/errors/404"
    yahoo:lang="en-US">
    <description>Resource not found</description>
    <detail>unknown app:
    yahoo:contactsdj0yJmk9N0FmdTN0VDIxdUZWJmQ9WVdrOU1VTmxUR3RXTkRRbWNHbzlNakV4TVRJe
    E5qTTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD01OQ--</detail>
    </error>

    ...

    This garbage next to "yahoo:contacts:" looks like some of OAuth tokens. It might help if you check the complete URI of the request and - just in case - check request headers. I have had similar problem which was caused by missing "Content-Type: application/json" header.
    0
  • Thanx Eugene.

    I had the same thought, but after checking the headers I didn't find the reported garbage anywhere in the headers (not event in the Authorization header after signing). I tried adding the content type header, but the result is the same. According to the API, leaving the content type header out should result in the service responding in XML.

    Any other clues that you may have are much appreciated.

    QUOTE (EugeneL @ Jun 17 2010, 07:20 AM) <{POST_SNAPBACK}>
    This garbage next to "yahoo:contacts:" looks like some of OAuth tokens. It might help if you check the complete URI of the request and - just in case - check request headers. I have had similar problem which was caused by missing "Content-Type: application/json" header.
    0
  • I did some further investigation and it seems that reported string is the encoded oauth_consumer_key value.

    Since this happens only on PUT and POST methods on Contacts API (Yahoo Mail API, with same authentication works fine), I'm wondering two things:

    1. Should I put the APP ID as an oauth header and what would its name be?
    2. Maybe something wrong with my key although I did register it for read/write operations?



    QUOTE (Aleksandar Pecanov @ Jun 17 2010, 11:16 PM) <{POST_SNAPBACK}>
    Thanx Eugene.

    I had the same thought, but after checking the headers I didn't find the reported garbage anywhere in the headers (not event in the Authorization header after signing). I tried adding the content type header, but the result is the same. According to the API, leaving the content type header out should result in the service responding in XML.

    Any other clues that you may have are much appreciated.
    0
  • QUOTE (Aleksandar Pecanov @ Jun 18 2010, 06:59 AM) <{POST_SNAPBACK}>
    I did some further investigation and it seems that reported string is the encoded oauth_consumer_key value.

    Since this happens only on PUT and POST methods on Contacts API (Yahoo Mail API, with same authentication works fine), I'm wondering two things:

    Can you try GET method with that same parameters? As far as I can imagine, PUT, POST and GET share the same authentication, if GET works, then the problem is with data encoding/representation. If GET fails, then the problem is with OAuth stuff.

    QUOTE (Aleksandar Pecanov @ Jun 18 2010, 06:59 AM) <{POST_SNAPBACK}>
    1. Should I put the APP ID as an oauth header and what would its name be?
    2. Maybe something wrong with my key although I did register it for read/write operations?

    I do not think you have to put AppID to the URI of your requests. FYI, here are URI parameters from successful PUT request I just ran:

    http://social.yahooapis.com/v1/user/guidHere/contacts?
    format=json&
    oauth_consumer_key=...&
    oauth_nonce=...&
    oauth_signature=...&
    oauth_signature_method=HMAC-SHA1&
    oauth_timestamp=1276880585&
    oauth_token=...&
    oauth_version=1.0

    Hope it helps.
    0
  • Hi Euegene. Thanks for the replies.

    I've successfully pulled contact lists and single contacts with GET method, so I guess OAuth setup is fine than.

    Now, my confusion is with what I should try next. The PUT requests for the sync I'm sending have only the Authorization header and the XML from the first post in the body. No query parameters, no body parameters and no additional headers (although I did try several different values for Content-Type).

    Any ideas ? :(Hope it helps.
    0
  • Aleksandar Pecanov ,

    did you find any solution to this?

    AA-
    0
  • Recent Posts

    in Contacts