Forum General "missing apiToken" error in "buy" dialog

Any issues or discussions relating to Flash development are welcome here.

"missing apiToken" error in "buy" dialog

Postby LazyLand » September 7th, 2015, 1:05 pm

I have implemented a bit of JS code to present the user with the "buy" dialog, in accordance with this page: https://gamesnet.yahoo.net/documentatio ... nts/dialog

What I get is a white and pink dialog box (like an error message) saying "Invalid argument(s) One of the given arguments has an invalid or missing value" and "missing apiToken: This dialog can only be shown with a valid apiToken"

Here's my code:

Code: Select all
                window.parent.YahooGames.dialog('buy', {
                    name: order_data.description,
                    description: "Get more " + order_data.cur_name + " in your game!",
                    icon: order_data.icon,
                    currency: 'usd',
                    amount: order_data.price,
                    transactionid: order_data.req_token,
                    foo: 'bar'
                }, function(data) {
                    // empty
                });


What am I doing wrong? Yahoo's documentation doesn't mention that an "apiToken" parameter is required or expected. What should I do?
LazyLand
 
Posts: 18
Joined: August 25th, 2015, 12:39 pm

Re: "missing apiToken" error in "buy" dialog

Postby LazyLand » September 7th, 2015, 1:09 pm

I went to my game webpage by clicking on "Test canvas" in the canvas setup page.
LazyLand
 
Posts: 18
Joined: August 25th, 2015, 12:39 pm

Re: "missing apiToken" error in "buy" dialog

Postby Henrik » September 7th, 2015, 3:33 pm

Did you load the YahooGames.js script, and setup window.YahooGamesSetup?

https://gamesnet.yahoo.net/documentation/yahoo/canvas
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: "missing apiToken" error in "buy" dialog

Postby LazyLand » September 7th, 2015, 5:31 pm

Henrik wrote:Did you load the YahooGames.js script, and setup window.YahooGamesSetup?

https://gamesnet.yahoo.net/documentation/yahoo/canvas


Hm... I hadn't replaced the userToken with the actual userToken, in YahooGamesSetup.

Thank you, I'll try that.
LazyLand
 
Posts: 18
Joined: August 25th, 2015, 12:39 pm

Re: "missing apiToken" error in "buy" dialog

Postby Henrik » September 7th, 2015, 6:05 pm

It's a crappy error message though, it should tell you how to fix the error. We can fix that at least.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: "missing apiToken" error in "buy" dialog

Postby LazyLand » September 8th, 2015, 12:24 pm

That solved my problem.
LazyLand
 
Posts: 18
Joined: August 25th, 2015, 12:39 pm


Return to General