Productsup
Platform API

Site stream data sources

List, create, update, and delete Stream API data sources on a site using the Platform API.

6 min read

The data source management endpoint lets you link Stream API streams to sites programmatically. You can create, update, delete, and inspect data source connections.

This endpoint supports unified authentication.

List stream data sources

curl --header 'X-Auth-Token: value' \
--header 'Content-Type: application/json' \
--request GET 'https://platform-api.productsup.io/platform/v2/sites/1/streams'
{
    "success": true,
    "Sources": [
        {
            "id": 1,
            "site_id": 1,
            "description": "stream api",
            "source": "",
            "import_type": 1,
            "import_id": 331,
            "status": "active",
            "settings": [
                "stream : 1"
            ]
        }
    ],
    "meta": {
        "cursor": {
            "current": 0,
            "prev": 0,
            "next": 1,
            "count": 1
        }
    }
}

GET https://platform-api.productsup.io/platform/v2/sites/<siteId>/streams

FieldTypeDescription
siteIdintegerSite identifier

See cursor parameters for pagination query fields.

HTTP headers

NameValue
Content-Typeapplication/json

Response fields

FieldTypeDescription
successbooleanIndicates request status
SourcesarrayList of data sources
metaarraySee cursor fields

Data source fields

FieldTypeDescription
idintegerData source identifier
site_idintegerIdentifier of the site this data source belongs to
descriptionstringDescription of the data source
statusstringSee status values
sourcestringURL of the data source
import_typeintegerSee import type values
import_idintegerImport method identifier
settingsarrayAll settings related to the data source

Status values

ValueDescription
activeThe data source is fully operational
pausedThe data source is paused and data is not imported

Import type values

ValueDescription
1Main data feed
2Additional data feed

Response status codes

CodeMessageDetails
200List returned successfully
401UnauthorizedInvalid authentication token
403You don't have the rights to access this resourceInsufficient permissions to access the site
404The requested resource could not be foundThe site does not exist

Create stream data source

curl --header 'X-Auth-Token: value' \
--header 'Content-Type: application/json' \
--request POST 'https://platform-api.productsup.io/platform/v2/sites/1/streams' \
--data-raw '{"import_type":1,"description":"stream api","stream_id":1,"status":"active"}'
{
    "success": true,
    "Sources": [
        {
            "id": 1,
            "site_id": 1,
            "description": "stream api",
            "source": "",
            "import_type": 1,
            "import_id": 331,
            "status": "active",
            "settings": ["stream : 1"]
        }
    ]
}

POST https://platform-api.productsup.io/platform/v2/sites/<siteId>/streams

FieldTypeDescription
siteIdintegerSite identifier

HTTP headers

NameValue
Content-Typeapplication/json

Request body fields

FieldTypeDescription
stream_idintegerStream identifier
import_typeintegerSee import type values. Defaults to 1.
descriptionstringDescription of the data source
statusstringSee status values. Defaults to active.

See response fields and data source fields for the response structure.

Response status codes

CodeMessageDetails
201Data source created and linked to the site
401UnauthorizedInvalid authentication token
403You don't have the rights to access this resourceInsufficient permissions to access the site or stream
404The requested resource could not be foundThe site or stream does not exist
422The stream datasource for the site already existsThe stream is already linked to this site

Update stream data source

curl --header 'X-Auth-Token: value' \
--header 'Content-Type: application/json' \
--request PUT 'https://platform-api.productsup.io/platform/v2/sites/1/streams/1' \
--data-raw '{"import_type":1,"description":"stream api","status":"active"}'

PUT https://platform-api.productsup.io/platform/v2/sites/<siteId>/streams/<streamId>

FieldTypeDescription
siteIdintegerSite identifier
streamIdintegerStream identifier

HTTP headers

NameValue
Content-Typeapplication/json

Request body fields

FieldTypeDescription
import_typeintegerSee import type values
descriptionstringDescription of the data source
statusstringSee status values

See response fields and data source fields for the response structure.

Response status codes

CodeMessageDetails
200Data source updated successfully
401UnauthorizedInvalid authentication token
403You don't have the rights to access this resourceInsufficient permissions to access the site or stream
404The requested resource could not be foundThe site or stream does not exist
422The stream datasource for the site doesn't existThe stream is not linked to this site

Delete stream data source

curl --header 'X-Auth-Token: value' \
--header 'Content-Type: application/json' \
--request DELETE 'https://platform-api.productsup.io/platform/v2/sites/1/streams/1'
{
    "success": true,
    "message": "Resource was deleted successfully!"
}

DELETE https://platform-api.productsup.io/platform/v2/sites/<siteId>/streams/<streamId>

FieldTypeDescription
siteIdintegerSite identifier
streamIdintegerStream identifier

HTTP headers

NameValue
Content-Typeapplication/json

Response fields

FieldTypeDescription
successbooleanIndicates request status
messagestringConfirmation message

Response status codes

CodeMessageDetails
200Data source deleted successfully
401UnauthorizedInvalid authentication token
403You don't have the rights to access this resourceInsufficient permissions to access the site or stream
404The requested resource could not be foundThe site or stream does not exist
422The stream datasource for the site doesn't existThe stream is not linked to this site

On this page

Still stuck?

Reach out to our support team and we’ll help you get unstuck.

Contact support