Page 1 of 1

Arcmage API

Posted: Wed Jun 06, 2018 17:36
by davidmfinol
Hi (I guess this post is directed at Nico?),

I mentioned a while back that I would like to integrate Arcmage with the card game simulator app that I am developing (https://www.cardgamesimulator.com), and I am hoping to use the Arcmage API.

I did some poking around (I hope that's OK), and I see the API at http://aminduna.arcmage.org/api/
It seems the full list of cards should be at http://aminduna.arcmage.org/api/cards?
Is it OK for me to use this endpoint to get the card info to use within CGS?
If so, is there any information available about how to use the endpoint?

If there's work that still needs to be done on the API, that's the kind of thing I would also love to help out with!

Re: Arcmage API

Posted: Thu Jun 07, 2018 15:43
by ngoeminne
Hi david,

That's indeed the api endpoint for our card database.
However its not documented.

It supports basic search on card name + the search fields when you click advanced searching, with paging.

there's also a deck endpoint where you can list the current decks, and there should be a call to get the deck itself (card + quantity, and some metadata)

If your game is not querying to much, I think it could be ok.
Maybe when getting the card-images you should use the jpeg urls, that would minimize the bandwidth.

If you're familiar with javascript/angularjs you could have a look at the carddb front end.

If you're familiar with javascript/vue you could have a look at our online game demo.
Just create a game, navigate to the games listing in two tabs, and select a deck + join.
It doesn't do much with the card-search api, but it does fetches the deck.

btw, everything is in github.

Kind regards,
Nico

Re: Arcmage API

Posted: Fri Jun 08, 2018 07:44
by davidmfinol
Thanks for the info, Nico!

I see how you can POST to the cards endpoint to do a search with pagination, but it doesn't seem like there is any pagination when making GET to http://aminduna.arcmage.org/api/cards.
What do you think about adding pagination on GET to that endpoint?

Re: Arcmage API

Posted: Fri Jun 08, 2018 15:44
by ngoeminne
Hi David,

The cards endpoint was intended to just fetch one card by guid, that it returns all cards when not specified is just a convenience I didn't take out.

To search cards, there's the a search endpoint.

http://aminduna.arcmage.org/api/CardSearch

Where you can post a json object to. e.g

{
"search":"",
"pageSize":30,
"pageNumber":1,
"orderBy":"Name",
"reverseOrder":false,
"status": {"id":3,"name":"Release Candidate","guid":"7dedc883-5dd2-5f17-b2a4-eaf04f7ad464"}
}

You can get the list of options available for each fixed search field (e.g. for the "status" field)

http://aminduna.arcmage.org/api/CardOptions

It returns all the metadata of the objects as well. To use it in a search, the guid is enough.
So the above post-data could be shortened to:

{
"search":"",
"pageSize":30,
"pageNumber":1,
"orderBy":"Name",
"reverseOrder":false,
"status": {"guid":"7dedc883-5dd2-5f17-b2a4-eaf04f7ad464"}
}

As this is fully functional, I'm not going to add paging to the cards' endpoint.

I'd also ask you not to create cards with the api. I know it ain't hard to do the login and add the bearer token header and then start creating cards with the api. Please don't do so, we'd like to keep the db clean.

If you really like to develop against the api, maybe you should consider to set it up locally.
Hope this info was useful.

Kind regards,
Nico

Re: Arcmage API

Posted: Thu Jul 12, 2018 19:14
by davidmfinol
Hi Nico,

Thanks again for all the information!
I think I've got Card Game Simulator pulling from the Arcmage API pretty well now.
It won't create any cards: It just pulls all the card info from the search endpoint.
I'll create a new thread with more info after I've done more testing and am ready to share.

Regards,
David