Job Chaining
Chain your upcoming jobs
Chaining jobs means linking all your job with each other by using TopicHash, to get your first TopicHash see this.
As you can see in Fig (A) and Fig (B), there is a field called TopicHash which will be used while creating jobs, and you can also create a job by using a topic(TopicHash).
Chain your previous jobs
Chaining your upcoming job to the previous one is only possible by using the previous LIVE mailed job's TopicHash or you can create a new topic by using the same name of the topic that you have already used in the previous mailed job's topic.
If you see in Diagram Fig (A) then it is clearly explained that you can keep the topic name the same, but by changing its subject, you can create a new topic for chaining your jobs with the same topic name.
As you can see, the name of the topic in Fig (A) is 2023 but the subject of each topic is changing to the name of the month. If we do the same as above, then we can easily able to fetch it all in one attempt by using the topic name or year 2023 (that is used for example). This will help to categorize our mailing in a better way, which will also help to search it easily.
Or, we can do it differently, instead of creating a new topic every time by changing its subject, you can keep both the name and the subject the same for each topic, which means you can create one Topic for chaining all similar type of your Jobs that will belong to your topic as it is already explained in Fig (B) where we are using a single topic (TopicHash) for chaining 100 jobs.
Steps of using TopicHash
STEP 1) Create a Topic and copy your TopicHash
STEP 2) Select a way to use the above TopicHash, either it would be Fig(A) or Fig(B).
STEP 3) Use step1 TopicHash while creating jobs
It's up to you that, how you want to use your topics, either you can follow Fig(A) or Fig(B).
Get previous mailing and their topics
By using the below-mentioned A{I}, we can easily able to fetch a list of previous mailings and its TopicHash that was mailed in Live mode, and we can use it to chain it with upcoming jobs.
Method: POST
Endpoint: https://api.dps.io/api
APIVersion: v1
route: jobs
path: {ShipperHash}
GET
https://api.dps.io/api/v1/jobs/{ShipperHash}
{
"Content-Type": "application/json",
"x-api-key": "<YOUR_API_KEY>",
"ShipperHash": "<YOUR_SHIPPER_HASH>"
}
Key | Type | Description |
---|---|---|
TopicHash | String | TopicHash of your previous job |
Name | String | Name of the topic that you have used in previous job's topic |
Subject | String | Subject of the topic that you have used in previous job's topic |
CreatedDate | DateTime | Previous job's created date |
LastStatus | String | Last Status of your previous job, it would be your tracking last status. |
PostageType | String | Postage name that you have used in previous job |
curl --location --request GET 'https://api.dps.io/api/v1/jobs/7z2PC******************bzAg' \
--header 'x-api-key: xxxxxxdfjbdjdfjdhfxxxxxxx' \
--header 'ShipperHash: 7z2PC******************bzAg' \
[
{
"TopicHash": "B4fI53*****280mYE",
"Name": "2023",
"Subject": "January",
"CreatedDate": "2022-12-02 09:40:55.826423",
"LastStatus": "Mailed",
"PostageType": "FC"
},
{
"TopicHash": "5Ufh7O********moxM3k",
"Name": "2023",
"Subject": "Tax Report",
"CreatedDate": "2022-06-03 09:32:39.616188",
"LastStatus": "Delivered",
"PostageType": "ERR"
}
]