Skip to content

SendTask

A send task sends a product to a specific DSP. Deliveries are performed one DSP at a time. When deliverable is true, the delivery starts on creation.

Note: The product must be active before creating a send task (except for delete deliveries). You cannot create a second task for the same product + DSP + delivery type while a previous one is still in progress (not error/completed).


Lists SendTasks

GET https://domain.com/api/v1/send-tasks

Headers

Name Type Description
Authorization* String Bearer \
Content-Type* String application/vnd.api+json

Response — 200 OK

{
  "data": [
    {
      "type": "send-tasks",
      "id": "<ID>",
      "attributes": {
        "deliverable": true,
        "delivery-type": "delivery",
        "status": "waiting",
        "priority": "normal",
        "send-date": "2023-08-11 20:50:02",
        "batch-id": "6daa1da7-21f4-7afa-aba0-027fc695b088",
        "ack-status-message": {
          "FileStatus": ["FileOK"]
        },
        "sent-at": null,
        "packaged-by": null,
        "sent-by": null,
        "message-id": "PADPIDA200010120333312786831",
        "sent-on": "20230811205002495",
        "created-by": "robot",
        "sent-on-behalf-of-name": null,
        "sent-on-behalf-of-dpid": null,
        "created-at": "2023-08-11T20:50:01.000000Z",
        "updated-at": "2023-08-11T20:52:35.000000Z"
      },
      "relationships": {
        "product": {
          "links": {
            "related": "https://domain.com/api/v1/send-tasks/<ID>/product",
            "self": "https://domain.com/api/v1/send-tasks/<ID>/relationships/product"
          }
        },
        "dsp-upload-identification": {
          "links": {
            "related": "https://domain.com/api/v1/send-tasks/<ID>/dsp-upload-identification",
            "self": "https://domain.com/api/v1/send-tasks/<ID>/relationships/dsp-upload-identification"
          }
        }
      },
      "links": {
        "self": "https://domain.com/api/v1/send-tasks/<ID>"
      }
    }
  ],
  "meta": {
    "page": {
      "currentPage": 1,
      "from": 1,
      "lastPage": 1,
      "perPage": 20,
      "to": 1,
      "total": 1
    }
  },
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "first": "https://domain.com/api/v1/send-tasks?page[number]=1&page[size]=20",
    "last": "https://domain.com/api/v1/send-tasks?page[number]=1&page[size]=20"
  }
}

Filters

Filter Example
ID /send-tasks?filter[id]=1
Product ID /send-tasks?filter[product-id]=42
Status /send-tasks?filter[status]=completed
Delivery type /send-tasks?filter[delivery-type]=delivery
DSP upload identification /send-tasks?filter[dsp-upload-identification-id]=1876
Created after /send-tasks?filter[created-at-gte]=2024-01-01
Created before /send-tasks?filter[created-at-lte]=2024-12-31

Status values

status Meaning
pending Initial state — the task has been created but the delivery has not started
waiting Delivery in progress — awaiting the DSP acknowledgment
procesing The delivery is being processed
completed The DSP acknowledged the delivery successfully — terminal success
error The delivery or acknowledgment failed

Get SendTask

GET https://domain.com/api/v1/send-tasks/:id

Path Parameters

Name Type Description
id* Number SendTask ID

Headers

Name Type Description
Authorization* String Bearer \
Content-Type* String application/vnd.api+json

Response — 200 OK

{
  "data": {
    "type": "send-tasks",
    "id": "<ID>",
    "attributes": {
      "deliverable": true,
      "delivery-type": "delivery",
      "status": "completed",
      "priority": "normal",
      "send-date": "2023-08-11 20:47:10",
      "batch-id": "a1b2c3d4-0000-0000-0000-000000000000",
      "ack-status-message": {
        "FileStatus": ["FileOK"]
      },
      "sent-at": null,
      "packaged-by": null,
      "sent-by": null,
      "message-id": "PADPIDA200010120333312786830",
      "sent-on": "20230811204710288",
      "created-by": "robot",
      "sent-on-behalf-of-name": null,
      "sent-on-behalf-of-dpid": null,
      "created-at": "2023-08-11T20:47:09.000000Z",
      "updated-at": "2023-08-11T20:52:23.000000Z"
    },
    "relationships": {
      "product": {
        "links": {
          "related": "https://domain.com/api/v1/send-tasks/<ID>/product",
          "self": "https://domain.com/api/v1/send-tasks/<ID>/relationships/product"
        }
      },
      "dsp-upload-identification": {
        "links": {
          "related": "https://domain.com/api/v1/send-tasks/<ID>/dsp-upload-identification",
          "self": "https://domain.com/api/v1/send-tasks/<ID>/relationships/dsp-upload-identification"
        }
      }
    },
    "links": {
      "self": "https://domain.com/api/v1/send-tasks/<ID>"
    }
  },
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "self": "https://domain.com/api/v1/send-tasks/<ID>"
  }
}

Create SendTask

POST https://domain.com/api/v1/send-tasks

Headers

Name Type Description
Authorization* String Bearer \
Content-Type* String application/vnd.api+json

Request Body

Name Required Type Description
deliverable Yes Boolean true to start the delivery on creation
delivery-type Yes String delivery / update / redelivery / delete
product Yes Object Product resource (relationship)
dsp-upload-identification Yes Object DspUploadIdentification resource (relationship)
sent-on-behalf-of-name No String Contact party name
sent-on-behalf-of-dpid No String Contact DPID

Response — 201 Created

{
  "data": {
    "type": "send-tasks",
    "id": "<ID>",
    "attributes": {
      "deliverable": true,
      "delivery-type": "delivery",
      "status": "waiting",
      "priority": "normal",
      "send-date": null,
      "batch-id": null,
      "ack-status-message": null,
      "sent-at": null,
      "packaged-by": null,
      "sent-by": null,
      "message-id": null,
      "sent-on": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "created-by": null,
      "sent-on-behalf-of-name": null,
      "sent-on-behalf-of-dpid": null,
      "created-at": "2023-08-11T20:47:09.000000Z",
      "updated-at": "2023-08-11T20:47:09.000000Z"
    },
    "relationships": {
      "product": {
        "links": {
          "related": "https://domain.com/api/v1/send-tasks/<ID>/product",
          "self": "https://domain.com/api/v1/send-tasks/<ID>/relationships/product"
        }
      },
      "dsp-upload-identification": {
        "links": {
          "related": "https://domain.com/api/v1/send-tasks/<ID>/dsp-upload-identification",
          "self": "https://domain.com/api/v1/send-tasks/<ID>/relationships/dsp-upload-identification"
        }
      }
    },
    "links": {
      "self": "https://domain.com/api/v1/send-tasks/<ID>"
    }
  },
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "self": "https://domain.com/api/v1/send-tasks/<ID>"
  }
}

Response — 422 Unprocessable Entity

{
  "jsonapi": {
    "version": "1.0"
  },
  "errors": [
    {
      "detail": "The delivery-type field is required.",
      "source": {
        "pointer": "/data/attributes/delivery-type"
      },
      "status": "422",
      "title": "Unprocessable Entity"
    }
  ]
}

Update SendTask

PATCH https://domain.com/api/v1/send-tasks/:id

Path Parameters

Name Type Description
id* Number SendTask ID

Headers

Name Type Description
Authorization* String Bearer \
Content-Type* String application/vnd.api+json

Request Body

All fields are optional on PATCH; omitted attributes keep their current values.

Name Required Type Description
deliverable No Boolean true / false
delivery-type No String delivery / update / redelivery / delete
status No String Delivery status

Response — 200 OK

{
  "data": {
    "type": "send-tasks",
    "id": "<ID>",
    "attributes": {
      "deliverable": false,
      "delivery-type": "update",
      "status": "waiting",
      "priority": "normal",
      "send-date": null,
      "batch-id": null,
      "ack-status-message": null,
      "sent-at": null,
      "packaged-by": null,
      "sent-by": null,
      "message-id": null,
      "sent-on": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "created-by": null,
      "sent-on-behalf-of-name": null,
      "sent-on-behalf-of-dpid": null,
      "created-at": "2023-08-11T20:47:09.000000Z",
      "updated-at": "2023-08-11T20:48:00.000000Z"
    },
    "relationships": {
      "product": {
        "links": {
          "related": "https://domain.com/api/v1/send-tasks/<ID>/product",
          "self": "https://domain.com/api/v1/send-tasks/<ID>/relationships/product"
        }
      },
      "dsp-upload-identification": {
        "links": {
          "related": "https://domain.com/api/v1/send-tasks/<ID>/dsp-upload-identification",
          "self": "https://domain.com/api/v1/send-tasks/<ID>/relationships/dsp-upload-identification"
        }
      }
    },
    "links": {
      "self": "https://domain.com/api/v1/send-tasks/<ID>"
    }
  },
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "self": "https://domain.com/api/v1/send-tasks/<ID>"
  }
}

Delete SendTask

DELETE https://domain.com/api/v1/send-tasks/:id

Send tasks cannot be deleted — this endpoint always returns 422.

Path Parameters

Name Type Description
id* Number SendTask ID

Headers

Name Type Description
Authorization* String Bearer \
Content-Type* String application/vnd.api+json

Response — 422 Unprocessable Entity

{
  "jsonapi": {
    "version": "1.0"
  },
  "errors": [
    {
      "status": "422",
      "title": "Unprocessable Entity",
      "detail": "Cannot delete a send task"
    }
  ]
}