source/get

Retrieve details of a Managed Source.

An HTTPS GET request sent to:

https://api.datasift.com/v1.3/source/get

A successful call to this endpoint returns: 200 OK plus a JSON object.

Parameters

Parameter Description
source_type
optional

Data source type name

Example values: facebook_page

page
optional

Results page to return. Defaults to 1.

Example values: 1

per_page
optional

Results per page. An integer. Defaults to 20.

Example values: 10

id
optional

Source ID. A string.

If you omit it, the response will contain the list of your sources.

Example values: fd2e72e3a7ae40c2a6e86e96381d8165

Examples

  1. Call /v1.3/source/get without a source ID:

    GET https://api.datasift.com/v1.3/source/get

  2. Call /v1.3/source/get with a source ID:

    GET https://api.datasift.com/v1.3/source/get?id=fd2e72e3a7ae40c2a6e86e96381d8165

Output

Success (id not specified) (HTTP Code: 200 OK)

Successful calls to /source/get return HTTP Code: 200 OK.

Please note that no error is returned when you have no sources defined and you call /source/get without a specific id. You will see:

{
    "count": 0,
    "page": 1,
    "pages": 0,
    "per_page": 20,
    "sources": []
}

When at least one source is defined, DataSift will send you a JSON response similar to the one shown below. In the case of this particular output you can see two Facebook Pages sources, the first one uses two resources (two pages), the second one uses just one page.

{
    "count": 2,
    "page": 1,
    "pages": 1,
    "per_page": 20,
    "sources": [
        {
            "name": "",
            "source_type": "facebook_page",
            "status": "running",
            "parameters": [],
            "auth": [
                {
                    "identity_id": "7b1be3a398e646bbb3c7a5cb9717ba45",
                    "source_id": "49fa6dcb175b4a8ca8cbedb8d9015ed0",
                    "status": "valid",
                    "parameters": {
                        "value": "363056350669209|09af1ce9c5d8d23147ec4eeb9a33aac2"
                    },
                    "expires_at": 1388556000
                }
            ],
            "resources": [
                {
                    "resource_id": "30bc448896de44b88604ac223cb7f26f",
                    "source_id": "49fa6dcb175b4a8ca8cbedb8d9015ed0",
                    "status": "valid",
                    "parameters": {
                        "url": "http://www.facebook.com/theguardian",
                        "title": "The Guardian",
                        "id": 10513336322
                    }
                },
                {
                    "resource_id": "d43024171340458fb6f124967fd126c1",
                    "source_id": "49fa6dcb175b4a8ca8cbedb8d9015ed0",
                    "status": "valid",
                    "parameters": {
                        "url": "http://www.giffgaff.com",
                        "title": "giffgaffmobile",
                        "id": 287613300716
                    }
                }
            ],
            "created_at": 1370266044,
            "id": "48fa6dcb175b4a8ca8cbedb8d9015ed0"
        },
        {
            "name": "",
            "source_type": "facebook_page",
            "status": "running",
            "parameters": [],
            "auth": [
                {
                    "identity_id": "0047a9e7f4bb4931b65e7e9bd299ddd1",
                    "source_id": "fd2e72e3a7ae40c2a6e86e96381d8165",
                    "status": "valid",
                    "parameters": {
                        "value": "363056350669209|09af1ce9c5d8d23147ec4eeb9a33aac2"
                    },
                    "expires_at": 1388556000
                }
            ],
            "resources": [
                {
                    "resource_id": "d6590d550db94266af6f53884dd65ca4",
                    "source_id": "fd2e72e3a7ae40c2a6e86e96381d8165",
                    "status": "valid",
                    "parameters": {
                        "url": "http://www.facebook.com/therollingstones",
                        "title": "The Rolling Stones",
                        "id": 8305888286
                    }
                }
            ],
            "created_at": 1370266045,
            "id": "fa2e72e3a7ae40c2a6e86e96381d8165"
        }
    ]
}

Success (id specified) (HTTP Code: 200 OK)

When you do specify a source id in a call to /source/get, you will see output similar to this:

{
    "name": "",
    "source_type": "facebook_page",
    "status": "running",
    "parameters": [],
    "auth": [
        {
            "identity_id": "0047a9e7f4bb4931b65e7e9bd299ddd1",
            "source_id": "fd2e72e3a7ae40c2a6e86e96381d8165",
            "status": "valid",
            "parameters": {
                "value": "363056350669209|09af1ce9c5d8d23147ec4eeb9a33aac2"
            },
            "expires_at": 1388556000
        }
    ],
    "resources": [
        {
            "resource_id": "d6590d550db94266af6f53884dd65ca4",
            "source_id": "fd2e72e3a7ae40c2a6e86e96381d8165",
            "status": "valid",
            "parameters": {
                "url": "http://www.facebook.com/therollingstones",
                "title": "The Rolling Stones",
                "id": 8305888286
            }
        }
    ],
    "created_at": 1370266044,
    "id": "fa2e72e3a7ae40c2a6e86e96381d8165"
}

Output Fields

Property: Description:
count The number of managed sources returned by this call.
page The page number.
pages Total number of pages.
per_page The maximum number of sources per page.
sources The list of the sources returned by the current call to /source/get. For the list of output fields see /source/create.
name The name of a source. Each source has one name element. For additional information, see /source/create.
status The status of a source. Each source has one status element. For additional information, see /source/create.
parameters Source- or resource-specific parameters. Each source and each resource has one parameters element. For additional information, see /source/create.
resources The list of all resources defined for the currect source. For additional information, see /source/create.
created_at The source creation date and time.
id The source ID.
source_type The source type.
auth The list of source-specific authentication credentials.

Errors

When things go wrong the Managed Sources API responds with the following errors:

Failure (HTTP Code: 404 Not Found)

Raised when the specified source does not exist.

{
    "error": "Could not find the specified source \"d77906e49a3d41e298d76e38782db084\""
}

Notes

  1. All calls to the API must be properly authenticated with a DataSift username and API key.
  2. All calls to the API must be versioned. The current version is v1.3.

Resource information

Rate limit cost: 5

Requires authentication: Yes

Response formats: JSON, JSONP