Arcmage API

All projects that somehow make usage of code.
Post Reply
davidmfinol
Posts: 5
Joined: Thu May 10, 2018 10:36

Arcmage API

Post by davidmfinol » Wed Jun 06, 2018 17:36

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!
ngoeminne
Posts: 277
Joined: Mon Feb 29, 2016 15:34

Re: Arcmage API

Post by ngoeminne » Thu Jun 07, 2018 15:43

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
davidmfinol
Posts: 5
Joined: Thu May 10, 2018 10:36

Re: Arcmage API

Post by davidmfinol » Fri Jun 08, 2018 07:44

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?
ngoeminne
Posts: 277
Joined: Mon Feb 29, 2016 15:34

Re: Arcmage API

Post by ngoeminne » Fri Jun 08, 2018 15:44

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
Post Reply