GET v1.3/reports

Search for reports available on this token. Can be used in combination with the 'account' or 'channel' filters. Other filters and sorting requirements may optionally be specified.

Parameters

Label Description Values Modifiers Type Required
account The unique id of an account to retrieve reports for
e.g _v1.3/reports?accounts=2
an account id none query string false
channel The unique id of a channel to retrieve reports for
e.g _v1.3/reports?channels=65481
a channel id none query string false

GET v1.3/reports/:id

Information about one report. Reports are initially queued onto a processing queue and have no generation_start_date or download attributes. Once generation starts the generation_start_date attribute appears. Once generation completes, a successful report will have generated_date and download attributes. On generation failure the failure attribute will contain a description of which phase of generation failed.

Parameters

Label Description Values Modifiers Type Required
id The unique id of a report
e.g v1.3/reports?id=2
an account "id" none query string false

POST v1.3/reports

Create a new report for one account or one channel. Either the channel or account values must be provided, along with the desired report date range (in the form of date_from and date_to fields. The date_type parameter specifies how the content items will be matched for report generation. Example request body:

{
    "account": 123,
    "date_from": "2013-01-01",
    "date_to":"2013-01-31",
    "date_type":"created_date"
}

Parameters

Label Description Values Modifiers Type Required
account The ID of the account to generate the report for. Must be specified only if "channel" is not an account id none post data false
channel The ID of the channel to generate the report for. Must be specified only if "account" is not a channel id none post data false
date_from The start of the date range to generate the report for. Information for this date will be included in the report. ISO date none post data true
date_to The end of the date range to generate the report for. Information for this date will be included in the report. ISO date none post data true
format Desired output format for the report xlsx, csv, json none post data false
date_type The type of date to match the date_from and date_to against. created_date, updated_date none post data true

Examples

Report during generation

> curl -u username:password "https://api.conversocial.com/v1.3/reports/5067"
{
    "report": {
        "name": "dump", "generation_start_date": "2012-05-30T17:09:40",
        "url": "https://api.conversocial.com/v1.3/reports/5067",
        "date_from": "2012-05-21",
        "generated_by": {
            "url": "https://api.conversocial.com/v1.3/moderators/11599",
            "id": "11599"
        },
        "generated_date": ,
        "channel": {
            "url": "https://api.conversocial.com/v1.3/channels/387",
            "id": "387"
        },
        "date_to": "2012-05-28",
        "id": "5067"
    }
}

Report after generation

> curl -u username:password "https://api.conversocial.com/v1.3/reports/5067"

# response
{
    "report": {
        "name": "dump", "generation_start_date": "2012-05-30T17:09:40",
        "url": "https://api.conversocial.com/v1.3/reports/5067",
        "date_from": "2012-05-21",
        "generated_by": {
            "url": "https://api.conversocial.com/v1.3/moderators/11599",
            "id": "11599"
        },
        "generated_date": "2012-05-30T17:09:41",
        "channel": {
            "url": "https://api.conversocial.com/v1.3/channels/387",
            "id": "387"
        },
        "date_to": "2012-05-28",
        "download": "https://s3.amazonaws.com/conversocial/reports/70c68360-1234/@twitter-from-may-21-2012-to-may-28-2012.zip",
        "id": "5067"
    }
}

View Reports available

> curl -u username:password "https://api.conversocial.com/v1.3/reports"

# response
{
    "reports": [
        {
            "url": "https://api.conversocial.com/v1.3/reports/5067",
            "id": "5067"
        },
        {
            "url": "https://api.conversocial.com/v1.3/reports/5072",
            "id": "5072"
        }
    ],
    "paging": { ... }
}

Create a new report

> curl -H "Content-Type: application/json" -X POST -d \
"{
    "account": 123,
    "date_from": "2013-01-01",
    "date_to":"2013-01-31",
    "date_type":"created_date"
}" \
"https://api.conversocial.com/v1.3/reports

# response
{
    "report": {
        "url": "https://api.conversocial.com/reports/1234",
        "id": "1234"
    }
}