Developers
petr_mlcoch
—
2016-05-04T08:17:23-04:00 —
#1
I am trying build ruby client (https://github.com/foton/playlyfe-ruby-client), which allows to select/set which action on behalf which player to trigger/play.
So connection is "playerless" and your app choose who do what.
Whole game should be designed created and maintained at Playlyfe.
There is Game master, which design game and create players (so no registration for them on Playlyfe is needed).
All game info is displayed for player(s) elsewhere. They do not need to know that backend is on Playlyfe.
I must say that I am excited by Your web app and Simulator but very disappointed by your API (especially the Ruby API).
When I try to use it , I expect something like resources:
-
Game, which have many
-
Players, whom may take an
-
Actions, to be awarded by
-
Levels, Badges
But your API seems to be highly attached to player and his point of view).
In your Ruby (and other) SDK there are credentials for API V1 to game titled 'LMS'. I use them for my tests too.
But I would like use your "dynamic API documentation" for consulting. And this allows me to work only with MY simulated games.
And these games, especially "https://games.playlyfe.com/ruby_client_test", do not have payed plan, so no API calls are allowed.
Is there any option, how to test my client against any game which is visible to my(anybodys) "dynamic API documentation"?
Other, of course, then spend money You give me ( 4 months on PACK plan).
I am willing to pay when I will use my client in production, but feel somehow itchy to pay when developing something which may help others and bring more users/designers to You.
Methods I would like to implement are (for example):
game.title
game.players
game.leaderboards
game.available_actions
Player.all
player.profile
player.play(action)
player.badges
player.metrics
player.teams
Team.all
team.player
and many others
By the way, You should somehow visible notified that block "Runtime" in API V2 documentation is clickable and can be changed to "Design" or "Admin".
rajanrastogi
—
2016-05-08T10:38:55-04:00 —
#2
Hi @Petr_Mlcoch
Welcome to the playlyfe forums. Sorry for the slightly delayed response.
You can very easily create such a game where playlyfe is completely hidden from your end users. You can create a client using the client credential OAuth flow:
https://dev.playlyfe.com/manuals/clients/client-credentials.html
With this client, you can create players via the API. You can even do actions on their behalf.
Yes, the simulator API is somewhat attached with to the player ID. That is required though and it replaces the users access token. Even in the case of the Admin API, you need to provide the player ID. I am not sure if I understand you correctly, let me know if you want something more specific here.
You should have $20 in your account, which you can use to test and develop your game. You can get an additional $40 though the referral program. That's almost an year's worth of free credit. If you still feel that is less, why don't you shoot an email to our supprt (support@playlyfe.com) and I am sure they would give you some extra bucks so that you can get your game setup.
All of the methods you requested are doable. Currently you will need to use a mix of both the Admin and Runtime API to do them. Ideally, they should all be possible via the Admin API alone and I think we have missed documenting some of the Admin routes, I will get in touch with the team and get back to you on this.
petr_mlcoch
—
2016-07-01T03:29:21-04:00 —
#3
tom_hay
—
2016-07-05T11:09:10-04:00 —
#4
@RajanRastogi, hello. I did all as you said. And trying to get/runtime/player. But getting error Your staging API usage has exceeded the limit of 0 API calls. Please upgrade your plan.
. Could you suggest something to me please?
khs
—
2016-07-06T09:21:36-04:00 —
#5
@Tom_Hay you need to buy a plan first.
petr_mlcoch
—
2016-07-07T03:20:27-04:00 —
#6
As khs said, API calls are only allowed for paid plans. This is easier but little expensive variant. But you have some initial USD from just signing to Playlyfe.
Harder, but cheaper variant is stub responses from API calls.
If you just trying things, look into /test/stubbed_api/v2_expected_responses.rb. There are hashes of responses (PlaylyfeClient::Connection.api ) from direct calls to Ruby Client Game. You can make your own fake responses and develop against them.