I have successfully used the API to generate a session and list the contents of the user's orders. However, when I try to use the API to get the details of a game, it keeps returning a 404 error indicating that the game ID cannot be found.
I have double checked the ID by reading from the order and also doing a general list of all games and reading the ID from that list. Both the ID of the game in the order and the ID of the game in the games list match.
I am using the request (with session_id provided):
Where the xxx is the ID of the game (i.e. the 37 or whatever it is character game code). I saw a note to be careful because IDs are case sensitive but the ID shows up as all caps when read.
I assume the game does not need to be published in order for the details to be fetched, correct?
A game's id cannot be fetched via receipt data, which as I write that I realize is likely a flaw in the API. But, it also means that whatever data you are using is wrong, and explains why it is failing.
You can fetch a users list of games from:
Or you could fetch their list of designers:
And then fetch the list of games from a designer:
Or if you go into the game editor in our UI, you can get a game's ID from the URL, and then fetch the game directly:
Also the session isn't the culprit, because you can fetch public info about a game without even using a session. For example: https://www.thegamecrafter.com/api/game/9C3B02AE-2052-11E5-8005-CBC3ADC92F5F
Nope, a game doesnt need to be published to read it.
I'll make a note to add the ability to fetch a game's ID and relationship from the order item data next week.
If you add _include_relationships=1 on your request of receipts
You'll get a relationship called "items". Note that you can also get the items relationship from the receipt directly if you know the receipt ID or URL (https://www.thegamecrafter.com/api/receipt/XXX?_include_relationships=1)
There then you can fetch that, again with _include_relationships=1
That will give you a relationship called "sku". And if you fetch that relationship it will turn into the appropriate object type (game, part, etc), depending upon what was in the order.