Skip to main content

Job Chaining

alt text

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

info

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

tip

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.

URL Config
Method: POST
Endpoint: https://api.dps.io/api
APIVersion: v1
route: jobs
path: {ShipperHash}
Method
GET
URL
https://api.dps.io/api/v1/jobs/{ShipperHash}
Request Headers
{
"Content-Type": "application/json",
"x-api-key": "<YOUR_API_KEY>",
"ShipperHash": "<YOUR_SHIPPER_HASH>"
}
Previous mailing response attributes
KeyTypeDescription
TopicHashStringTopicHash of your previous job
NameStringName of the topic that you have used in previous job's topic
SubjectStringSubject of the topic that you have used in previous job's topic
CreatedDateDateTimePrevious job's created date
LastStatusStringLast Status of your previous job, it would be your tracking last status.
PostageTypeStringPostage name that you have used in previous job
Curl request
curl --location --request GET 'https://api.dps.io/api/v1/jobs/7z2PC******************bzAg' \
--header 'x-api-key: xxxxxxdfjbdjdfjdhfxxxxxxx' \
--header 'ShipperHash: 7z2PC******************bzAg' \
Response Body
[
{
"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"
}
]