Skip to content

Commit ebe1c68

Browse files
feat(API): add manual triggering of automations #SCM-953 (#968)
1 parent 0312fe3 commit ebe1c68

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

doc/compiled.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28849,6 +28849,51 @@
2884928849
}
2885028850
]
2885128851
}
28852+
},
28853+
"/accounts/{account_id}/automations/{automation_id}/trigger": {
28854+
"post": {
28855+
"summary": "Trigger an automation",
28856+
"description": "Trigger an automation.\n",
28857+
"operationId": "automation/trigger",
28858+
"tags": [
28859+
"Automations"
28860+
],
28861+
"parameters": [
28862+
{
28863+
"$ref": "#/components/parameters/X-PhraseApp-OTP"
28864+
},
28865+
{
28866+
"$ref": "#/components/parameters/account_id"
28867+
},
28868+
{
28869+
"$ref": "#/components/parameters/id"
28870+
}
28871+
],
28872+
"responses": {
28873+
"204": {
28874+
"$ref": "#/components/responses/204"
28875+
},
28876+
"400": {
28877+
"$ref": "#/components/responses/400"
28878+
},
28879+
"404": {
28880+
"$ref": "#/components/responses/404"
28881+
},
28882+
"429": {
28883+
"$ref": "#/components/responses/429"
28884+
}
28885+
},
28886+
"x-code-samples": [
28887+
{
28888+
"lang": "Curl",
28889+
"source": "curl \"https://api.phrase.com/v2/accounts/:account_id/automations/:id/trigger\" \\\n -u USERNAME_OR_ACCESS_TOKEN\n -X POST\n -H 'Content-Type: application/json'"
28890+
},
28891+
{
28892+
"lang": "CLI v2",
28893+
"source": "phrase automations trigger \\\n--account_id <account_id> \\\n--id <id> \\\n--access_token <token>"
28894+
}
28895+
]
28896+
}
2885228897
}
2885328898
}
2885428899
}

paths.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,3 +735,6 @@
735735
"/accounts/{account_id}/automations/{automation_id}/deactivate":
736736
post:
737737
"$ref": "./paths/automations/deactivate.yaml"
738+
"/accounts/{account_id}/automations/{automation_id}/trigger":
739+
post:
740+
"$ref": "./paths/automations/trigger.yaml"

paths/automations/trigger.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
summary: Trigger an automation
3+
description: |
4+
Trigger an automation.
5+
operationId: automation/trigger
6+
tags:
7+
- Automations
8+
parameters:
9+
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
10+
- "$ref": "../../parameters.yaml#/account_id"
11+
- "$ref": "../../parameters.yaml#/id"
12+
responses:
13+
'204':
14+
"$ref": "../../responses.yaml#/204"
15+
'400':
16+
"$ref": "../../responses.yaml#/400"
17+
'404':
18+
"$ref": "../../responses.yaml#/404"
19+
'429':
20+
"$ref": "../../responses.yaml#/429"
21+
x-code-samples:
22+
- lang: Curl
23+
source: |-
24+
curl "https://api.phrase.com/v2/accounts/:account_id/automations/:id/trigger" \
25+
-u USERNAME_OR_ACCESS_TOKEN
26+
-X POST
27+
-H 'Content-Type: application/json'
28+
- lang: CLI v2
29+
source: |-
30+
phrase automations trigger \
31+
--account_id <account_id> \
32+
--id <id> \
33+
--access_token <token>

0 commit comments

Comments
 (0)