MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

appParams in Notification

Last post 07-14-2009 6:16 PM by CodeStorm. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-14-2009 1:19 AM

    appParams in Notification

    Hi,

     I am using the RESTful interface in order to send notifications to users.  I am able to get the notifications working properly, but I would like to attach some appParams to the button in the notification.  Is there any way to do that with the RESTful interface? I know that its possible with the OpenSocial container, but I wasnt able to find anything about doing this with the REST interface.

    Here's the body of my POST request.

    recipients=xxxxxx&templateParameters={"content":"hello world","button0_surface":"canvas","button0_label":"Hi There"}

     And heres the documentation that I've read through:

    http://wiki.developer.myspace.com/index.php?title=App_Notifications

    http://wiki.developer.myspace.com/index.php?title=POST_v1_applications_applicationId_notifications

     Any help would be greatly appreciated

    Filed under: ,
  • 07-14-2009 12:51 PM In reply to

    Re: appParams in Notification

    Hi,

    You can use button0_params/button1_params.  You'll need to double URL encode the params

     { "action":"hithere"}

    encoded once: %7B+%22action%22%3A%22hithere%22%7D

    encoded twice: %257B%2B%2522action%2522%253A%2522hithere%2522%257D

     example:

     {"content":"hello world","button0_label":"Hi There","button0_surface":"canvas","button0_params":"%257B
    %2522action%2522%253A%2522hithere%2522%257D","button1_label":"Bye","button1_surface":"canvas","button1_params"
    :"%257B%2522action%2522%253A%2522bye%2522%257D"}

     


  • 07-14-2009 5:24 PM In reply to

    Re: appParams in Notification

    Thanks, you're awesome!  Would be great to include that in the documentation, or maybe I just missed it? Either way, it looks like its working, heres the finalized body of my post for future reference in case anyone is curious.  Also, I had to triple url encode the appParams part of it for some reason, but the appParams definitely are being passed

     

    recipients=41446524&templateParameters=%7b%22content%22%3a%22Vdream%20lijen%20has%20challenged%20you%20to%20a%20race%20on%20vDream%20Racing.%20Are%20you%20game%3f%22%2c%22button0_surface%22%3a%22canvas%22%2c%22button0_label%22%3a%22View%20Challenge%22%2c%22button0_params%22%3a%22%25257B%252522page%252522%3a%252522track%2fchallengers%252522%2c%252522vref%252522%3a%25252277%252522%25257D%22%7d

  • 07-14-2009 6:16 PM In reply to

    Re: appParams in Notification

     You're welcome.  And, yes, if it's not in the documentation, it should be added.

     

Page 1 of 1 (4 items)