Working with Contracts¶
In this guide we explore how to use the Control API to get contract information.
What are Contracts¶
Everything in the Crowdynews platform operates on a contract level.
All entities that are managed by the Control API belong to a contract.
You will often need the _id
property of the contract when
operating on entities. Sometimes the contract is referenced
by its slug
property, for example in the Content API.
Contract filter¶
A contract has an optional reference to a filter by means of
a filterId
property. This filter is used when collections and/or inputs do not specify a
filter. Therefore the contract filter acts as a default filter.
See the Filter Guide for more information.
Getting contract information¶
The Control API has an endpoint to retrieve all contracts that a consumer has access to. It will return a list of contracts based on the access token. See the Authorization Guide for information on how to obtain an access token.
example¶
Request
GET https://api.crowdynews.com/v1/customer/contracts/me?access_token={your access token}
Response
HTTP/1.1 200
[
{
"_id": "5617895587c6f35d3b9a2b6f",
"name": "My Contract",
"slug": "My_Contract",
"label": "Custom Label",
"active": true,
"customerId": "56a587c26e7bb91c509285b8",
"productId": "47ac87c26e7bb91a109325c3",
"filterId": "37ab57c26e7bb91c509885c8",
"createdBy": "Example User",
"lastModifiedBy": "Example User",
"created": "2016-03-02T13:05:14.137Z",
"lastModified": "2016-03-02T14:04:10.126Z"
}
]