Curl Example

NOTE: Get an APIKey.

Get a Session

 curl -X POST -F username=joe -F password=abc123 -F api_key_id=XXX https://www.thegamecrafter.com/api/session

Fetch My Account Info

 curl -X GET -F session_id=XXX https://www.thegamecrafter.com/api/user/YYY

You can get the user_id (YYY) from the session.

Upload a File

 curl -X POST -F session_id=XXX -F name=image.jpg -F folder_id=YYY -F file=@/path/to/image.jpg https://www.thegamecrafter.com/api/file

You can get the folder_id (YYY) from the root_folder_id in the user account info.

Search Games

 curl -X GET -F session_id=XXX -F q=Steampunk https://www.thegamecrafter.com/api/game

Session ID is optional for this.

Create a Game

 curl -X POST -F session_id=SESSIONIDGOESHERE -F name=NAMEITSOMTHING https://www.thegamecrafter.com/api/game

Create a Large Acrylic Shape

 curl -X POST -F session_id=SESSIONIDGOESHERE -F name=NAMEITSOMETHING -F identity=LargeAcrylicShape125 -F game_id=GAMEIDGOESHERE -F side1_is=has_art -F side2_is=has_art -F quantity=1 -F side1_id=IDOFFACEART -F side2_id=IDOFBACKART -F cut_id=IDOFCUTSVGFILE -F has_proofed_side1=1 -F has_proofed_side2=1  https://www.thegamecrafter.com/api/acrylicshape

Create a Cart

 curl -X POST -F session_id=SESSIONID -F api_key_id=APIKEY http://www.thegamecrafter.com/api/cart

Add a Game to a Cart

 curl -X POST -F session_id=SESSIONID https://www.thegamecrafter.com/api/cart/CARTID/sku/SKUID

The Cart ID was in the output when you created a cart. The Sku ID was in the output when you created your game.

^ Back to Top ^