Newscoop REST API allows you to read and write data. Detailed list of respources and (their types) can be found in autogenerated documentation: example.com/documentation/rest-api
We use HTTP methods to operate on these resources or collections of resources.
Method |
Collection |
Resource |
---|---|---|
GET |
fetch resources |
fetch resource |
POST |
create a resource in this collection |
|
PUT |
|
create or update a resource here |
PATCH |
|
update part of a resource |
DELETE |
|
delete a resource |
example.com/api/ - prefix for API.
example.com/documentation/rest-api - auto-generated current Newscoop version API documentation
Default number of results on the page is 10.
Parameter name |
value |
Description |
---|---|---|
page |
integer |
results page number |
sort |
array |
array of sort directions indexed by column name e.g. sort[name]=asc |
items_per_page |
integer |
override number of results in the response |
GET /articles?page={integer}&sort={array}&items_per_page={integer}
If response does not contain all of the result resources, we append to the response special pagination object:
"pagination": { "itemsPerPage": {integer}, "currentPage": {integer}, "nextPageLink": {string}, // /articles/?page=2 "previousPageLink": {string}, // /articles/?page=1 "itemsCount": {integer} }
If client doesn't want whole response object, then he can choose particular fields:
GET /articles?fields=title,date,number
Parameter name |
value |
Description |
---|---|---|
fields |
string |
Comma separated list of properties of requested objects. |
Keys with null value will be removed from response.
We use the Accept and Content-Type headers to agree what formats to use. But for now we support only application/json.
Response codes
Code |
Message |
Description |
---|---|---|
200 |
OK |
Success! |
304 |
Not Modified |
There was no new data to return. |
400 |
Bad Request |
The request was invalid. An accompanying error message will explain why. This is the status code will be returned during rate limiting. |
401 |
Unauthorized |
Authentication credentials were missing or incorrect. |
403 |
Forbidden |
The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits. |
404 |
Not Found |
The URI requested is invalid or the resource requested, such as a user, does not exists. |
500 |
Internal Server Error |
Something is broken. |
502 |
Bad Gateway |
API is down or being upgraded. |
503 |
Service Unavailable |
API servers are up, but overloaded with requests. Try again later. |
504 |
Gateway timeout |
The API servers are up, but the request couldn't be serviced due to some failure within our stack. Try again later. |
{ "errors":[ { "message":"Something is broken.", "code":500 } ] }
There has been error in communication with Booktype server. Not sure right now where is the problem.
You should refresh this page.