Skip to content

/connections endpoint

The /connections endpoint provides management functions for creating, listing, updating, enabling, and disabling DropStream connections.

List

To get a list of existing connections, make a GET request to /connections.

Endpoint/connections
MethodGET
AuthJWT
Success statusHTTP 200
Response (JSON)array of connections
Example
curl -H "Authorization: Bearer $JWT_TOKEN" \
    https://api.getdropstream.com/connections

Response:

[
    {
        "id": 2706,
        "customer_id": 3775,
        "warehouse_id": 4609,
        "store_id": 5603,
        "name": "My Connection",
        "connection_type": "fulfillment",
        "created_at": "2020-08-19T14:57:20.000Z",
        "enabled_at": null,
        "locations": []
    },
    ...
    {
        "id": 2716,
        ...
    }
]
HTTP/1.1 200 OK

Create

To create a new connection, make a POST request to /connections with the new connection properties.

Endpoint/connections
MethodPOST
AuthJWT
PayloadProperties of the new connection object
Required properties
  • name — A name for the connection (string)
  • customer_id — an existing customer ID (integer), or a new customer object to be created
  • store_id — an existing store ID (integer), or a new store object to be created
  • warehouse_id — an existing warehouse ID (integer), or a new warehouse object to be created. If neither is provided, the customer's default warehouse is used.
Additional RequirementsThe combination of customer_id, store_id, and warehouse_id must be unique to the new connection
Success statusHTTP 201
Response (JSON)id of the new connection
Example
curl -X POST \
    -H "Authorization: Bearer $JWT_TOKEN" \
    -H "Content-Type: application/json" \
    https://api.getdropstream.com/connections \
    -d @- <<EOF
{
    "name": "My New Connection",
    "customer": {
        "company_name": "foo"
    },
    "store": {
        "adapter": {
            "auth_token": "abc123xyz890",
            "secret_key": "mysecret"
        },
        "description": "My Sellbrite Store",
        "name": "My Store",
        "platform": "sellbrite"
    },
    "warehouse": {
        "adapter": {
            "connection_string": "sftp://wh1:secret@ftp.getdropstream.com"
        },
        "description": "My New Warehouse",
        "platform": "dropstream"
    }
}
EOF
curl -X POST \
    -H "Authorization: Bearer $JWT_TOKEN" \
    https://api.getdropstream.com/connections \
    -d @- <<EOF
name=My New Connection&
customer[company_name]=foo&
store[adapter][auth_token]=abc123xyz890&
store[adapter][secret_key]=mysecret&
store[description]=My Sellbrite Store&
store[name]=My Store&
store[platform]=sellbrite&
warehouse[adapter][connection_string]=sftp://wh1:secret@ftp.getdropstream.com&
warehouse[description]=My New Warehouse&
warehouse[platform]=dropstream
EOF

Response:

{ "id" : 5678 }
HTTP/1.1 201 Created

Update

To update an existing connection, make a PATCH request to /connections/{id} with the updated connection properties.

Endpoint/connections/{connection_id}
MethodPATCH
AuthJWT
Payloadthe updated connection properties
Success statusHTTP 204
Example
curl -X PATCH \
    -H "Authorization: Bearer $JWT_TOKEN" \
    -H "Content-Type: application/json" \
    https://api.getdropstream.com/connections/1234 \
    -d @- <<EOF
{ "enabled_at" : "2019-01-01" }
EOF
curl -X PATCH \
    -H "Authorization: Bearer $JWT_TOKEN" \
    https://api.getdropstream.com/connections/1234 \
    -d @- <<EOF
enabled_at=2019-01-01
EOF

Response:

HTTP/1.1 204 No Content

Enable

To enable a connection, make a PATCH request to /connections/{id} with an updated "enabled_at" value.

Endpoint/connections/{connection_id}
MethodPATCH
AuthJWT
Payload (JSON){ "enabled_at" : {dateString} }
Success statusHTTP 204
Example
curl -X PATCH \
    -H "Authorization: Bearer $JWT_TOKEN" \
    -H "Content-Type: application/json" \
    https://api.getdropstream.com/connections/1234 \
    -d @- <<EOF
{ "enabled_at" : "2019-01-01" }
EOF

Response:

HTTP/1.1 204 No Content

Disable

To disable a connection, set its "enabled_at" value to null.

Endpoint/connections/{connection_id}
MethodPATCH
AuthJWT
Payload (JSON){ "enabled_at" : null }
Success statusHTTP 204
Example
curl -X PATCH \
    -H "Authorization: Bearer $JWT_TOKEN" \
    -H "Content-Type: application/json" \
    https://api.getdropstream.com/connections/1234 \
    -d @- <<EOF
{ "enabled_at" : "2019-01-01" }
EOF

Response:

HTTP/1.1 204 No Content