This API is a basic solution for a game application where users create Gif Groups under a common theme. The API is written in Go and backed by Redis. Responses are in JSON, and responds to the following endpoints:
Routes are prefixed with `/api/v{version_number}
- [GET] /api//groups - returns all groupings of gifs
- [GET] /groups/{id}/gifs - returns all gifs for the group matching the id specified
- [POST] /groups - creates a new group with name
- [POST] /groups/{id}/gifs - creates a new gif within the group matching the id specified
In order to get the api running locally:
git clone
this repoAWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
need to be provided the proper keys for developmentcd cc-gifgroup-api
godep go install
cc-gifgroup-api
curl http://localhost:1323/groups
Response format will be in JSON, and follow the structure below:
{
"success": true,
"status_code": 200,
"status_text": "OK",
"error_code": 0,
"error_text": "No error",
"content": [ // ... array of response objects ]
}
Returns all groupings of gifs.
e.g. curl http://localhost:1323/api/v1/groups
Returns all gifs for grouping corresponding to the specified {id}
parameter.
e.g. curl http://localhost:1323/api/v1/groups/1/groups
Creates a new gif grouping.
e.g. curl -F "name=[group_name]" -F "image=@[image_path] http://localhost:1323/api/v1/groups
Creates a new gif within grouping corresponding to the specified {id}
parameter.
e.g. curl -F "image=@[image_path] http://localhost:1323/api/v1/groups/{id}/gifs