API - JumboCode/BINJ GitHub Wiki

API

The stories follows a RESTful standards to create, read, update, and filter stories from the application. All data is returned in JSON format.

Story Operations

Add a Story

To add a story, send a POST request to /stories/ with data matching the schema in the body.

Delete a Story

To delete a story, send a DELETE request to /stories/{id} where {id} is the id of the story to be deleted.

Update a Story

To update a story, send a PUT request to /stories/{id} where {id} is the id of the story to be updated. The updated story should be contained in the body of the request.

View Stories

To view all the stories, send a GET request to /stories/.

Viewing a specific story

To view a specific story, send a GET request to /stories/{id} where id is the id of the story to be viewed.

Filter View

To get a filtered list of stories, send a GET request to /stories/{filter}/{value} where {filter} is the property to filter by and and {value} is the desired value that matches all stories in the returned list.

Get Image URL From Story

To get the main image from a binj story, send a GET request to /imgurl with the added query parameter url={binj_story_url}. This will return JSON with either the image's URL or an error message.

For example: https://binj-map.herokuapp.com/imgurl?url=https://medium.com/binj-reports/we-came-we-saw-we-covered-a-fightsupremacy-composite-retrospect-941966fd60d4