Welcome Developers!

in

Welcome!

in

Notification Api problem

Last post 01-25-2012 3:52 AM by Kirill. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 01-25-2012 3:52 AM

    • Kirill
    • Not Ranked
    • Joined on 12-06-2011
    • Posts 7

    Notification Api problem

    When i try to send notification, i have this response:

    HTTP/1.1  201  Created
    Cache-Control:  private
    Content-Length:  121
    Content-Type:  application/json;  charset=utf-8
    Location:  http://opensocial.myspace.com/roa/09/notifications/myspace.com.person.576567226/@self/1327492190
    Server:  Microsoft-IIS/7.5
    X-Server:  8041a8fa14c95dcb149e2cfd20a80283b7a92c6850429287
    Accept:  */*
    Host:  opensocial.myspace.com
    CLIENT-IP:  85.115.220.198
    X-PoweredBy:  Keebler  Elves
    Date:  Wed,  25  Jan  2012  11:49:50  GMT

    {"statusLink":"http:\/\/opensocial.myspace.com\/roa\/09\/notifications\/myspace.com.person.576567226\/@self\/1327492190"}

    When i try to follow the statusLink i have 401 error with empty description:

    {"statusCode":"401","statusDescription":""}

    There is request description.

    Request url

    http://opensocial.myspace.com/roa/09/notifications/myspace.com.person.576567226/@self?oauth_version=1.0&oauth_nonce=436c6a80cf1dd84ecafa9a4abe82f918&oauth_timestamp=1327492186&oauth_consumer_key=d01d074aaeb04535b60a9157457c43c5&oauth_signature_method=HMAC-SHA1&oauth_signature=wR31aeq%2BkQM0piYPAt4wEUToFIs%3D

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300);
    curl_setopt($ch, CURLOPT_TIMEOUT, 300);

    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
    curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array( implode("\r\n", $h) ) );

    $data = curl_exec($ch);

     Post body

    {"recipientIds":["577776173"],  "templateParameters":[{"key":"content","value":"Notification  from  Kirill"},{"key":"button0_surface","value":"canvas"},{"key":"button0_label","value":"Go  To  App"},{"key":"button1_surface","value":"appProfile"},{"key":"button1_label","value":"Go  To  App  Profile"}],  "mediaItems":[{"msMediaItemUri":"http://api.myspace.com/v1/users/576567226"}]}

     

    But i have no notifications.

    Where is my problem?

Page 1 of 1 (1 items)