Working with delivery methods using the API
Overview
Check the list of available endpoints and methods to work with delivery methods using the Delivery Configuration API:
Endpoints and methods | Description |
---|---|
status:GET | Lists the delivery methods defined in the domain. |
status:GET | Gets a detailed description of a specific delivery method. |
status:POST | Creates a new delivery method. |
status:POST | Sends the code to validate a delivery method. |
status:posT | Validates a delivery method. |
status:PUT | Updates a delivery method. |
status:delete | Deletes a specific delivery method. |
Endpoints and methods
GET /methods
Retrieves a list of the delivery methods in the domain. The list can be filtered by type using the query parameter.
To perform this request, your Devo user must have at least theAlert configuration (view)permission assigned. Also, note that this request will only retrieve those delivery methods which comply with users delivery method specific policies (Jira, Slack)
Learn more about roles and permissions in this article.
Request
Query string parameters
Query string parameters are optionally added after the path parameters, preceded by a question mark (?
) and separated by an ampersand ()
Parameter | Type | Definition |
---|---|---|
|
| Delivery method type to be filtered. Available values are:
Learn more about the delivery method types in Devo in this section. |
Example
Find below a request example in cURL language. This request will retrieve all the email type delivery methods in the domain that corresponds to the given token. Learn how to authorize your request in this article.
curl -H "standAloneToken:YOUR_TOKEN" -X GET "https://api-us.devo.com/delco/methods?type=email"
Response
Check the list of available responses:
Code | Description |
---|---|
200 | Successful response. Available delivery methods retrieved. [
{
"id": 0,
"name": "Delivery method name",
"type": "email",
"status": true,
"config": {
"timezone": "Europe/Madrid",
"locale": "en",
"email": "user@email.com",
"attachEvents": "string",
"maxEvents": 0
}
}
] |
400 | Request error. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
403 | Authentication required. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
GET /methods/{id}
Gets a detailed description of a specific delivery method given its ID.
To perform this request, your Devo user must have at least theAlert configuration (view)permission assigned and the specific permission (view) for the delivery method type you are retrieving. Learn more about roles and permissions in this article.
Request
Path parameters
Add the following path parameters as part of the endpoint:
Parameter | Type | Definition |
---|---|---|
|
| ID of the delivery method you want to retrieve. How can I get the ID of a delivery method? You can use the GET |
Example
Find below a request example in cURL language. This request will retrieve detailed information about the delivery method with ID 10
. Learn how to authorize your request in this article.
curl -H "standAloneToken:YOUR_TOKEN" -X GET "https://api-us.devo.com/delco/methods/10"
Response
Check the list of available responses:
Code | Description |
---|---|
200 | Successful response. Details of the delivery method retrieved. [
{
"id": 10,
"name": "Delivery method name",
"type": "email",
"status": true,
"config": {
"timezone": "Europe/Madrid",
"locale": "en",
"email": "user@email.com",
"attachEvents": "string",
"maxEvents": 0
}
}
] |
400 | Request error. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
403 | Authentication required. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
POST /methods
Creates a new delivery method in your domain.
To perform this request, your Devo user must have theAlert configuration (manage)permission assigned and the specific permission (manage) for the delivery method type you are creating. Learn more about roles and permissions in this article.
Request
Request body
You must specify the parameters of the new delivery method in the request body:
Parameter | Type | Definition |
---|---|---|
|
| Name of the new delivery method. |
|
| Delivery method type. Available values are:
Learn more about the delivery method types in Devo in this section. |
|
| Include this parameter and set it to |
|
| This JSON object includes the following parameters:
Then, include the following parameters depending of the delivery method type you want to create: - - - - - - - -
- - - - - - - - - - - - - - - - - - - Choose either
- Note that specifying a value that does not exist in your ServiceNow instance will return an empty value in the alert. - Note that specifying a value that does not exist in your ServiceNow instance will return an empty value in the alert. - - |
Example
Find below examples to create each of the delivery method types. Learn how to authorize your request in this article.
Email delivery method
curl --location --request POST 'https://api-us.devo.com/delco/methods' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
"name": "email_test",
"type": "email",
"status": true,
"config": {
"email": "user@devo.com",
"timezone": "Europe/Madrid",
"locale": "en",
"attachEvents": true,
"maxEvents": 4
}
}'
HTTP-JSON delivery method
curl --location --request POST 'https://api-us.devo.com/delco/methods' --header "standAloneToken:$token" --header 'Content-Type: application/json' --data '{
"name": "http_test_api",
"type": "httpjson",
"status": true,
"config": {
"timezone": "Europe/Paris",
"locale": "en",
"contentType":"application/json",
"customHeaders": {
"header1": "test",
"header2": "test2"
},
"urlDestination": "https://webhook.site/3a0591c2-7ec6-443b-98fb-203bbee44ca9"
}
}'
Jira delivery method
curl --location --request POST 'https://api-us.devo.com/delco/methods' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
"name": "http_test",
"type": "jira",
"status": true,
"config": {
"issueType": "Test",BpxcAx-KOs=CFAC07B0",
"projectKey": "AT",
"urlDestination":"https://devoinc.atlassian.net/rest/",
"user":"user@devo.com",
"timezone": "Europe/Paris",
"locale": "en",
"port": "443"
}
}'
Pushover delivery method
curl --location --request POST 'https://api-us.devo.com/delco/methods' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
"name": "qa_pushoOverRegressiond011020236",
"type": "servicedesk",
"config": {
"timezone": "Europe/Paris",
"locale": "en",
"appToken": "anitabcdefghijklmjp",
"userGroup": "g482028agajahaka"
}
}'
Service Desk delivery method
curl --location --request POST 'https://api-us.devo.com/delco/methods' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
"name": "qa_pushoOverRegressiond011020236",
"type": "pushover",
"config": {
"timezone": "Europe/Paris",
"locale": "en",
"key": "my_key",
"urlDestination": "http://localhost:8080/sdpapi/request/"
}
}'
Service Now delivery method
curl --location --request POST 'https://api-us.devo.com/delco/methods' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
"name": "service_now",
"type": "servicenow",
"config": {
"timezone": "Europe/Madrid",
"locale": "es",
"clientId": "36165ac0ba92311016e632221f35e45e",
"clientSecret": "^Wj5!id7[i",
"company":"DelcoDevo",
"password":"%RkJxI!6.99tk5",
"user":"admin",
"urlDestination":"https://dev76477.service-now.com/api/now/table/incident",
"assigmentGroup": "QA",
"company": "Devo"
}
}'
Slack delivery method
curl --location --request POST 'https://api-us.devo.com/delco/methods' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
"name": "qa_slackRegresssion01102023",
"type": "slack",
"config": {
"channel": "alert_test",
"webhook": "https://hooks.slack.com/services/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",
"locale": "en",
"timezone": "Europe/Madrid"
}
}'
Response
Check the list of available responses:
Code | Description |
---|---|
200 | Operation succeeded. Delivery method created. [
{
"id": 0,
"name": "Delivery method name",
"type": "email",
"status": true,
"config": {
"timezone": "Europe/Madrid",
"locale": "en",
"email": "user@email.com",
"attachEvents": "string",
"maxEvents": 0
}
}
] |
400 | Request error. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
403 | Authentication required. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
POST /methods/{id}/send-validation-code
Sends the code required to validate a delivery method.
To perform this request, your Devo user must have theAlert configuration (manage)permission assigned and the specific permission (manage) for the delivery method type you are creating. Learn more about roles and permissions in this article.
Request
Path parameters
Add the following path parameters as part of the endpoint:
Parameter | Type | Definition |
---|---|---|
|
| ID of the delivery method you want to validate. How can I get the ID of a delivery method? You can use the GET |
Example
Find below a request example in cURL language. This request will send the code to validate the delivery method with ID 10
. Learn how to authorize your request in this article.
curl --location --request POST 'https://api-us.devo.com/delco/methods/10/send-validation-code' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json'
Response
Check the list of available responses:
Code | Description |
---|---|
200 | Successful response. Validation code sent. |
400 | Request error. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
403 | Authentication required. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
POST /methods/{id}/validate
Validate a delivery method that is pending validation.
Request
Path parameters
Add the following path parameters as part of the endpoint:
Parameter | Type | Definition |
---|---|---|
|
| ID of the delivery method you want to validate. How can I get the ID of a delivery method? You can use the GET |
Query string parameters
Query string parameters are optionally added after the path parameters, preceded by a question mark (?
) and separated by an ampersand ()
Parameter | Type | Definition |
---|---|---|
|
| Enter the code required to validate the delivery method. How can I get the code of a delivery method? You need check the validation code you received in the defined delivery method when you created it. If necessary, you can use the GET |
Example
Find below a request example in cURL language. This request will validate the delivery method with ID 10
. Learn how to authorize your request in this article.
curl --location --request POST 'https://api-us.devo.com/delco/methods/10/validate?code=12345' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json'
Response
Check the list of available responses:
Code | Description |
---|---|
200 | Successful response. Delivery method validated. |
400 | Request error. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
403 | Authentication required. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
PUT /methods/{id}
Updates a specific delivery method.
To perform this request, your Devo user must have theAlert configuration (manage)permission assigned and the specific permission (manage) for the delivery method type you are creating. Learn more about roles and permissions in this article.
Request
Path parameters
Add the following path parameters as part of the endpoint:
Parameter | Type | Definition |
---|---|---|
|
| ID of the delivery method you want to update. How can I get the ID of a delivery method? You can use the GET |
Request body
You must specify the updates you need to apply to the delivery method in the request body:
Parameter | Type | Definition |
---|---|---|
|
| Name of the new delivery method. |
|
| Delivery method type. Available values are:
Learn more about the delivery method types in Devo in this section. |
|
| Include this parameter and set it to |
|
| This JSON object includes the following parameters:
Then, include the following parameters depending of the delivery method type you want to create: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Choose either - - - Note that specifying a value that does not exist in your ServiceNow instance will return an empty value in the alert. - Note that specifying a value that does not exist in your ServiceNow instance will return an empty value in the alert. - - |
Example
Find below examples to create each of the delivery method types. Learn how to authorize your request in this article.
Email delivery method
curl --location --request PUT 'https://api-us.devo.com/delco/methods' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
"name": "email_test",
"type": "email",
"status": true,
"config": {
"email": "user@devo.com",
"timezone": "Europe/Madrid",
"locale": "en",
"attachEvents": true,
"maxEvents": 4
}
}'
HTTP-JSON delivery method
curl --location --request PUT 'https://api-us.devo.com/delco/methods' --header "standAloneToken:$token" --header 'Content-Type: application/json' --data '{
"name": "http_test_api",
"type": "httpjson",
"status": true,
"config": {
"timezone": "Europe/Paris",
"locale": "en",
"contentType":"application/json",
"customHeaders": {
"header1": "test",
"header2": "test2"
},
"urlDestination": "https://webhook.site/3a0591c2-7ec6-443b-98fb-203bbee44ca9"
}
}'
Jira delivery method
curl --location --request PUT 'https://api-us.devo.com/delco/methods' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
"name": "http_test",
"type": "jira",
"status": true,
"config": {
"issueType": "Test",BpxcAx-KOs=CFAC07B0",
"projectKey": "AT",
"urlDestination":"https://devoinc.atlassian.net/rest/",
"user":"user@devo.com",
"timezone": "Europe/Paris",
"locale": "en",
"port": "443"
}
}'
Pushover delivery method
curl --location --request PUT 'https://api-us.devo.com/delco/methods' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
"name": "qa_pushoOverRegressiond011020236",
"type": "servicedesk",
"config": {
"timezone": "Europe/Paris",
"locale": "en",
"appToken": "anitabcdefghijklmjp",
"userGroup": "g482028agajahaka"
}
}'
Service Desk delivery method
curl --location --request PUT 'https://api-us.devo.com/delco/methods' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
"name": "qa_pushoOverRegressiond011020236",
"type": "pushover",
"config": {
"timezone": "Europe/Paris",
"locale": "en",
"key": "my_key",
"urlDestination": "http://localhost:8080/sdpapi/request/"
}
}'
Service Now delivery method
curl --location --request PUT 'https://api-us.devo.com/delco/methods' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
"name": "service_now",
"type": "servicenow",
"config": {
"timezone": "Europe/Madrid",
"locale": "es",
"clientId": "36165ac0ba92311016e632221f35e45e",
"clientSecret": "^Wj5!id7[i",
"company":"DelcoDevo",
"password":"%RkJxI!6.99tk5",
"user":"admin",
"urlDestination":"https://dev76477.service-now.com/api/now/table/incident",
"assigmentGroup": "QA",
"company": "Devo"
}
}'
Slack delivery method
curl --location --request PUT 'https://api-us.devo.com/delco/methods' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
"name": "qa_slackRegresssion01102023",
"type": "slack",
"config": {
"channel": "alert_test",
"webhook": "https://hooks.slack.com/services/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",
"locale": "en",
"timezone": "Europe/Madrid"
}
}'
Response
Check the list of available responses:
Code | Description |
---|---|
200 | Operation succeeded. Delivery method created. [
{
"id": 0,
"name": "Delivery method name",
"type": "email",
"status": true,
"config": {
"timezone": "Europe/Madrid",
"locale": "en",
"email": "user@email.com",
"attachEvents": "string",
"maxEvents": 0
}
}
] |
400 | Request error. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
403 | Authentication required. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
DELETE /methods/{id}
Deletes a specific delivery method given its ID.
To perform this request, your Devo user must have theAlert configuration (manage)permission assigned and the specific permission (manage) for the delivery method type you are deleting. Learn more about roles and permissions in this article.
Request
Path parameters
Add the following path parameters as part of the endpoint:
Parameter | Type | Definition |
---|---|---|
|
| ID of the delivery method you want to delete. How can I get the ID of a delivery method? You can use the GET |
Example
Find below a request example in cURL language. This request will delete the delivery method with ID 10
. Learn how to authorize your request in this article.
curl -H "standAloneToken:YOUR_TOKEN" -X DELETE "https://api-us.devo.com/delco/methods/10"
Response
Check the list of available responses:
Code | Description |
---|---|
204 | No content. Successful response.Delivery method deleted. |
400 | Request error. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |
403 | Authentication required. {
"code": 0,
"msg": "string",
"cid": "string",
"context": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"messageKey": "string",
"language": "string"
} |