Get all Inputs

Get information for all inputs that belong to a specific contract, or for all inputs that belong to a collection.

Endpoint

GET https://api.crowdynews.com/collection/inputs

Request Parameters

QUERY PARAMETER VALUE DESCRIPTION
access_token A valid OAuth access token with the correct permission(s).
contract_id A resource ID that specifies on which contract to filter. The consumer that wants to retrieve the inputs must have access to the specified contract, otherwise this action is forbidden.
collection_id Optional. A resource ID that specifies on which collection to filter. The consumer that wants to retrieve the inputs must have access to the contract the specified collection belongs to and must be the same contract as specified in the contract_id query parameter, otherwise this action is forbidden.

Response Format

On success, the HTTP status code in the response header is 200 OK and the response body will contain one or more input objects in JSON format. If there are no inputs for the specified contract/collection, an empty array will be returned in JSON format. On error, the header status code is an error code and the response body contains an error object.

Example Request

1. Get all Inputs for Contract 565c4df4056e859526e62257

Request:

GET https://api.crowdynews.com/collection/inputs?contract_id=565c4df4056e859526e62257&access_token={your access token}

Response:

HTTP/1.1 200

[
    {
        "_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"
    },

    {
        "_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"
    },

    {
        "_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"
    },

    {
        "_id": "565d4de40f6e5595f6e68222",
        "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": "redux",
        "contractId": "565c4df4056e859526e62257",
        "collectionId": "565d4de4046e659546e62152"
    }
]

2. Get all Inputs for Contract 565c4df4056e859526e62257 and Collection 565d4de4046e659546e62152

Request:

GET https://api.crowdynews.com/collection/inputs?contract_id=565c4df4056e859526e62257&collection_id=565d4de4046e659546e62152&access_token={your access token}

Response:

HTTP/1.1 200

[
    {
        "_id": "565d4de40f6e5595f6e68222",
        "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": "redux",
        "contractId": "565c4df4056e859526e62257",
        "collectionId": "565d4de4046e659546e62152"
    }
]

Additional Resources