curl --request POST \
--url https://api.sandbox.usenash.com/v1/templates/upsert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templates": [
{
"type": "DELIVERY_WINDOW",
"deliveryWindowTemplatePayload": {
"key": "value"
},
"shiftTemplatePayload": {
"key": "value"
},
"externalId": "ext_01234567890123456789",
"name": "Monday Delivery Window",
"startDatetime": "2024-01-01T12:00:00",
"endDatetime": "2024-01-01T12:00:00",
"daysOfWeek": [
"MONDAY",
"TUESDAY"
],
"generationFrequencyValue": 1,
"generationFrequencyUnit": "DAY",
"createInstancesUpToValue": 1,
"createInstancesUpToUnit": "DAY",
"overrideExistingInstances": true
}
]
}
'{
"templates": [
{
"id": "tpl_01234567890123456789",
"type": "DELIVERY_WINDOW",
"payload": {},
"externalId": "<string>",
"name": "<string>",
"startDatetime": "2024-01-01T12:00:00",
"endDatetime": "2024-01-01T12:00:00",
"daysOfWeek": [
"MONDAY",
"TUESDAY"
],
"generationFrequencyValue": 1,
"generationFrequencyUnit": "DAY",
"createInstancesUpToValue": 1,
"createInstancesUpToUnit": "DAY",
"overrideExistingInstances": true
}
]
}curl --request POST \
--url https://api.sandbox.usenash.com/v1/templates/upsert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templates": [
{
"type": "DELIVERY_WINDOW",
"deliveryWindowTemplatePayload": {
"key": "value"
},
"shiftTemplatePayload": {
"key": "value"
},
"externalId": "ext_01234567890123456789",
"name": "Monday Delivery Window",
"startDatetime": "2024-01-01T12:00:00",
"endDatetime": "2024-01-01T12:00:00",
"daysOfWeek": [
"MONDAY",
"TUESDAY"
],
"generationFrequencyValue": 1,
"generationFrequencyUnit": "DAY",
"createInstancesUpToValue": 1,
"createInstancesUpToUnit": "DAY",
"overrideExistingInstances": true
}
]
}
'{
"templates": [
{
"id": "tpl_01234567890123456789",
"type": "DELIVERY_WINDOW",
"payload": {},
"externalId": "<string>",
"name": "<string>",
"startDatetime": "2024-01-01T12:00:00",
"endDatetime": "2024-01-01T12:00:00",
"daysOfWeek": [
"MONDAY",
"TUESDAY"
],
"generationFrequencyValue": 1,
"generationFrequencyUnit": "DAY",
"createInstancesUpToValue": 1,
"createInstancesUpToUnit": "DAY",
"overrideExistingInstances": true
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Expected payload for creating multiple templates.
Show child attributes
Template type (e.g., DELIVERY_WINDOW)
"DELIVERY_WINDOW"
Required for DELIVERY_WINDOW templates
{ "key": "value" }Required for SHIFT templates
{ "key": "value" }External identifier for the template
"ext_01234567890123456789"
The name of the template.
"Monday Delivery Window"
The start datetime of the template.
"2024-01-01T12:00:00"
The end datetime of the template.
"2024-01-01T12:00:00"
Days of the week for template usage
["MONDAY", "TUESDAY"]How often to create instances (value)
1
How often to create instances (unit)
"DAY"
How far into the future to create instances (value)
1
How far into the future to create instances (unit)
"DAY"
Whether to overwrite existing instances
true
OK
Response for a list of templates.
Show child attributes
The ID of the template.
"tpl_01234567890123456789"
Template type (e.g., DELIVERY_WINDOW)
"DELIVERY_WINDOW"
Required for templates
External identifier for the template
Name of the template
The start datetime of the template.
"2024-01-01T12:00:00"
The end datetime of the template.
"2024-01-01T12:00:00"
Days of the week for template usage
["MONDAY", "TUESDAY"]How often to create instances (value)
1
How often to create instances (unit)
"DAY"
How far into the future to create instances (value)
1
How far into the future to create instances (unit)
"DAY"
Whether to overwrite existing instances
true