Team Feed API API Reference
Goals
-
Developer friendliness:
- Simple authentication
- Semantic, readable endpoints (e.g.
DELETE http://hostname/api/v1/post/15/reaction/
) - Comprehensive endpoints (contains all data neccessary for consumption. e.g. a Like object, will contain the related User object)
-
Design
- Individually versioned endpoints
-
Speed
- Background workers
- Query caching
URL Format
Do not forget the trailing slash i.e.
/api/v1/comment/32/
Credentials
Pass on the flockEventToken
parameter that you get from Flock, like so:
https://flockwall-backend-production.herokuapp.com/flockhandler/auth/?flockEventToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBJZCI6ImZjMzdhOTE3LTBlMGUtNDRjZi1hZTM3LWY3MjZlOTE3MTQ3ZSIsImV4cCI6MTU4NTIwNjgzNiwidXNlcklkIjoidTpjYzFtYTg5bm5kNGptOXZmIiwiaWF0IjoxNDg0NjAyMDM2LCJqdGkiOiJjM2M4MjRkMC02NjIxLTQ1ZjctODZmOC0xZmYxNmZiYTQ5NjIifQ.DeGHPWQf0QbJyDMmPOD3gAKegsfggsfExsCrGSyj6N4
You will recieve:
{
"user_id": 1,
"user": "cc1ma89nnd4jsg3",
"token": "9d1e3f7b-dbea-4cf7-sgfsg-a5e244d35910",
"name": "Bob",
"display_pic": "https://i.flockusercontent2.com/cc1ma89nnd4jm9vf?r=1169335537"
}
Save the user_id
, user
and token
values, you'll
need them for later.
Structure
The Envelope
Every response is contained by an envelope. That is, each response has a predictable set of keys with which you can expect to interact:
{
"meta": {
"status": "OK"
},
"data": {
...
}
}
META
The meta key is used to communicate extra information about the response to the developer.
Success Example
{
"meta": {
"status": "OK",
}
}
Error Example
{
"meta": {
"status": "error",
"status_message": "Unauthorized",
"status_code": 401
}
}
DATA
The data key is the meat of the response. It may be a list or dictionary, but either way this is where you'll find the data you requested.
PAGINATION
Coming Soon!
API Endpoint
https://flockwall-backend-production.herokuapp.com/api/
Contact: stallon@flock.com
Schemes: https
Version: v1
Authentication
X-Auth-User
X-Auth-Token
Post
POST /v1/post/
Create a new post
The content of the post
OK
Response Example (200 OK)
{
"properties": {
"data": {
"properties": {
"id": {
"description": "id of the created post",
"type": "integer"
}
},
"type": "object"
}
},
"type": "object"
}
GET /v1/post/{post-id}
Get a post object
(no description)
OK
Response Example (200 OK)
{
"properties": {
"data": {
"$ref": "#/definitions/Post"
}
},
"type": "object"
}
DELETE /v1/post/{post-id}
Delete a post object
(no description)
OK
Response Example (200 OK)
{
"properties": {
"data": {
"type": "object"
}
},
"type": "object"
}
Feed
GET /v1/feed/self/
Get the user's feed
OK
Response Example (200 OK)
{
"properties": {
"data": {
"items": {
"$ref": "#/definitions/Reaction"
},
"type": "array"
}
},
"type": "object"
}
Reactions
POST /v1/post/{post-id}/reaction/
Add a reaction to the post.
May be "like" or "dislike"
(no description)
OK
Response Example (200 OK)
{
"properties": {
"data": {
"type": "object"
}
},
"type": "object"
}
DELETE /v1/post/{post-id}/reaction/
Delete reaction from the post
(no description)
OK
Response Example (200 OK)
{
"properties": {
"data": {
"type": "object"
}
},
"type": "object"
}
GET /v1/post/{post-id}/reactions/
Get all the reactions on a post.
(no description)
OK
Response Example (200 OK)
{
"properties": {
"data": {
"items": {
"$ref": "#/definitions/Reaction"
},
"type": "array"
}
},
"type": "object"
}
Comments
POST /v1/post/{post-id}/comment/
Add a comment to the post.
The content of the comment
(no description)
OK
Response Example (200 OK)
{
"properties": {
"id": {
"description": "id of the created post",
"type": "integer"
}
},
"type": "object"
}
GET /v1/post/{post-id}/comments/
Get all the comments on a post.
(no description)
OK
Response Example (200 OK)
{
"properties": {
"data": {
"items": {
"$ref": "#/definitions/Comment"
},
"type": "array"
}
},
"type": "object"
}
GET /v1/comment/{comment-id}/
Get an individual comment.
(no description)
OK
Response Example (200 OK)
{
"properties": {
"data": {
"$ref": "#/definitions/Comment"
}
},
"type": "object"
}