Create an Input¶
Create an input to specify what kind of content and from which service said content must be collected.
Endpoint¶
POST https://api.crowdynews.com/collection/inputs
Request Parameters¶
HEADER FIELD | VALUE DESCRIPTION |
---|---|
Content-Type | The content type of the request body, must be set to application/json . |
QUERY PARAMETER | VALUE DESCRIPTION |
---|---|
access_token | A valid OAuth access token with the correct permission(s). |
REQUEST BODY DATA | VALUE TYPE | VALUE DESCRIPTION |
---|---|---|
service | String | The service from which content will be collected. Supported services are:
|
type | String | The type of content that will be collected. This depends on the service that is being used. Supported types per service are:
|
input | String | The value to query on to collect content, but as plain text. For example:
|
contractId | String | The resource ID that specifies to which contract this input belongs. The consumer that wants to create the input must have access to the provided contract, otherwise this action is forbidden. |
collectionId | String | The resource ID that specifies which collection this input belongs. The collection must belong to the same contract that is referenced in the contractId property and the consumer that wants to create this input must have access to said contract, otherwise this action is forbidden. |
filterId | String | Optional. The resource ID that specifies which filter to use to control content automatically. The filter must belong to the same contract that is referenced in the contractId property and the consumer that wants to create this input must have access to said contract, otherwise this action is forbidden. |
latitude | Number | Only required for type location. A coordinate, must be between -90 and 90 , for example 38.887533 . |
longitude | Number | Only required for type location. A coordinate, must be between -180 and 180 , for example 1.407564 . |
radius | Number | Only required for type location. The radius for the location circle (determined by the latitude and longitude properties) in meters, for example 45 . |
display | Boolean | Optional. Specifies if the collected content resulting from this input must be displayed in the publication content feed by default. For example, if set to false , all collected content resulting from this input will not be displayed in a publication content feed. A user will then have to manually select the content items in the content queue (i.e. moderate) which may be displayed when publishing said content. This property defaults to true when omitted. |
active | Boolean | Optional. Specifies if this input will be processed by the platform. This property defaults to true when omitted. |
Bulk Operations¶
To create multiple inputs in one go, provide an array of input objects as the request payload. For more information on how to do this, see the bulk example request.
Response Format¶
On success, the HTTP status code in the response header is
201 Created
and the response body will contain an
input object in JSON format.
When a bulk request is made, the response body will contain
an array of input objects in JSON format.
On error, the header status code is an error code
and the response body contains an error object.
Example Requests¶
- Twitter User
- Twitter Keyword
- Facebook Page
- Instagram Tag
- Instagram Location
- Youtube Channel
- Youtube Playlist
- Tumblr User
- Vimeo Album
- Flickr Tag
- VK User
- Bulk
1. Collect Content from Twitter for User @crowdynews
¶
Request:
POST https://api.crowdynews.com/collection/inputs?access_token={your access token}
{
"service": "twitter",
"type": "user",
"input": "crowdynews",
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
}
Response:
HTTP/1.1 201
{
"_id": "565d4de40f6e5595f6e68111",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "twitter",
"type": "user",
"input": "crowdynews",
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
}
2. Collect Content from Twitter for Keyword #tgif
¶
Request:
POST https://api.crowdynews.com/collection/inputs?access_token={your access token}
{
"service": "twitter",
"type": "keyword",
"input": "tgif",
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
}
Response:
HTTP/1.1 201
{
"_id": "565d4de40f6e5595f6e68112",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "twitter",
"type": "keyword",
"input": "tgif",
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
}
3. Collect Content from Facebook for Page Crowdynews
¶
Request:
POST https://api.crowdynews.com/collection/inputs?access_token={your access token}
{
"service": "facebook",
"type": "page",
"input": "Crowdynews",
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
}
Response:
HTTP/1.1 201
{
"_id": "565d4de40f6e5595f6e68113",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "facebook",
"type": "page",
"input": "Crowdynews",
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
}
4. Collect Content from Instagram for Tag #summer
¶
Request:
POST https://api.crowdynews.com/collection/inputs?access_token={your access token}
{
"service": "instagram",
"type": "tag",
"input": "summer",
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
}
Response:
HTTP/1.1 201
{
"_id": "565d4de40f6e5595f6e68114",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "instagram",
"type": "tag",
"input": "summer",
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
}
5. Collect Content from Instagram for Location Bora Bora Ibiza
within a Radius of 50
meters¶
Request:
POST https://api.crowdynews.com/collection/inputs?access_token={your access token}
{
"service": "instagram",
"type": "location",
"input": "Bora Bora Ibiza",
"latitude": 38.887533,
"longitude": 1.407564,
"radius": 45,
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
}
Response:
HTTP/1.1 201
{
"_id": "565d4de40f6e5595f6e68115",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "instagram",
"type": "location",
"input": "Bora Bora Ibiza",
"latitude": 38.887533,
"longitude": 1.407564,
"radius": 45,
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
}
6. Collect Content from Youtube for Channel Google Developers
¶
Request:
POST https://api.crowdynews.com/collection/inputs?access_token={your access token}
{
"service": "youtube",
"type": "channel",
"input": "UC_x5XG1OV2P6uZZ5FSM9Ttw",
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
}
Response:
HTTP/1.1 201
{
"_id": "565d4de40f6e5595f6e68116",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "youtube",
"type": "channel",
"input": "UC_x5XG1OV2P6uZZ5FSM9Ttw",
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
}
7. Collect Content from Youtube for Playlist Web and Chrome at Google I/O 2016
¶
Request:
POST https://api.crowdynews.com/collection/inputs?access_token={your access token}
{
"service": "youtube",
"type": "playlist",
"input": "PLNYkxOF6rcIDz1TzmmMRBC-kd8zPRTQIP",
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
}
Response:
HTTP/1.1 201
{
"_id": "565d4de40f6e5595f6e68117",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "youtube",
"type": "playlist",
"input": "PLNYkxOF6rcIDz1TzmmMRBC-kd8zPRTQIP",
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
}
8. Collect Content from Tumblr for User devopsreactions
¶
Request:
POST https://api.crowdynews.com/collection/inputs?access_token={your access token}
{
"service": "tumblr",
"type": "user",
"input": "devopsreactions",
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
}
Response:
HTTP/1.1 201
{
"_id": "565d4de40f6e5595f6e68118",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "tumblr",
"type": "user",
"input": "devopsreactions",
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
}
9. Collect Content from Vimeo for Album Documentary
¶
Request:
POST https://api.crowdynews.com/collection/inputs?access_token={your access token}
{
"service": "vimeo",
"type": "album",
"input": "5612",
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
}
Response:
HTTP/1.1 201
{
"_id": "565d4de40f6e5595f6e68119",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "vimeo",
"type": "album",
"input": "5612",
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
}
10. Collect Content from Flickr for Tag air
¶
Request:
POST https://api.crowdynews.com/collection/inputs?access_token={your access token}
{
"service": "flickr",
"type": "tag",
"input": "air",
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
}
Response:
HTTP/1.1 201
{
"_id": "565d4de40f6e5595f6e68120",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "flickr",
"type": "tag",
"input": "air",
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
}
11. Collect Content from VK for User putin
¶
Request:
POST https://api.crowdynews.com/collection/inputs?access_token={your access token}
{
"service": "vk",
"type": "user",
"input": "putin",
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
}
Response:
HTTP/1.1 201
{
"_id": "565d4de40f6e5595f6e68121",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "flickr",
"type": "tag",
"input": "air",
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
}
12. Bulk¶
Request:
POST https://api.crowdynews.com/collection/inputs?access_token={your access token}
[
{
"service": "twitter",
"type": "user",
"input": "AtomEditor",
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
},
{
"service": "youtube",
"type": "keyword",
"input": "golang",
"collectionId": "565d4de4046e659546e62151",
"contractId": "565c4df4056e859526e62257"
}
]
Response:
HTTP/1.1 201
[
{
"_id": "565d4de40f6e5595f6e67432",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "twitter",
"type": "user",
"input": "AtomEditor",
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
},
{
"_id": "565d4de40f6e5595f6e67433",
"created": "2016-03-22T15:01:49.081Z",
"createdBy": "John Doe",
"lastModified": "2016-03-22T15:01:49.081Z",
"lastModifiedBy": "John Doe",
"active": true,
"display": true,
"service": "youtube",
"type": "keyword",
"input": "golang",
"contractId": "565c4df4056e859526e62257",
"collectionId": "565d4de4046e659546e62151"
}
]