Skip to content

Commit 8d66989

Browse files
MirkoCorwigeg
andauthored
[TSS-73232] Update docs for webhook deliveries (#213)
* [TSS-73232] Update docs for webhook deliveries * Typo * fix error * identifier -> id * not required query string param * change description * update compiled json Co-authored-by: Elizabeth Orwig <orwigelizabeth@gmail.com>
1 parent 06d1a80 commit 8d66989

File tree

9 files changed

+448
-0
lines changed

9 files changed

+448
-0
lines changed

doc/compiled.json

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@
168168
},
169169
{
170170
"name": "Webhooks"
171+
},
172+
{
173+
"name": "Webhook Deliveries"
171174
}
172175
],
173176
"x-tagGroups": [
@@ -2412,6 +2415,36 @@
24122415
"updated_at": "2015-01-28T09:52:53Z"
24132416
}
24142417
},
2418+
"webhook_delivery": {
2419+
"type": "object",
2420+
"title": "webhook delivery",
2421+
"properties": {
2422+
"id": {
2423+
"type": "string"
2424+
},
2425+
"webhook_id": {
2426+
"type": "string"
2427+
},
2428+
"response_status_code": {
2429+
"type": "integer"
2430+
},
2431+
"delivered_at": {
2432+
"type": "string",
2433+
"format": "date-time"
2434+
},
2435+
"duration_ms": {
2436+
"type": "integer"
2437+
},
2438+
"created_at": {
2439+
"type": "string",
2440+
"format": "date-time"
2441+
},
2442+
"updated_at": {
2443+
"type": "string",
2444+
"format": "date-time"
2445+
}
2446+
}
2447+
},
24152448
"space": {
24162449
"type": "object",
24172450
"title": "space",
@@ -3493,6 +3526,24 @@
34933526
"type": "integer"
34943527
},
34953528
"example": 25
3529+
},
3530+
"webhook_id": {
3531+
"in": "path",
3532+
"name": "webhook_id",
3533+
"description": "Webhook ID",
3534+
"required": true,
3535+
"schema": {
3536+
"type": "string"
3537+
}
3538+
},
3539+
"response_status_codes": {
3540+
"in": "query",
3541+
"name": "response_status_codes",
3542+
"description": "List of Response Status Codes",
3543+
"required": false,
3544+
"schema": {
3545+
"type": "string"
3546+
}
34963547
}
34973548
},
34983549
"responses": {
@@ -22123,6 +22174,216 @@
2212322174
}
2212422175
}
2212522176
}
22177+
},
22178+
"/projects/{project_id}/webhooks/{webhook_id}/deliveries": {
22179+
"get": {
22180+
"summary": "List webhook deliveries",
22181+
"description": "List all webhook deliveries for the given webhook_id.",
22182+
"operationId": "webhook_deliveries/list",
22183+
"tags": [
22184+
"Webhook Deliveries"
22185+
],
22186+
"parameters": [
22187+
{
22188+
"$ref": "#/components/parameters/X-PhraseApp-OTP"
22189+
},
22190+
{
22191+
"$ref": "#/components/parameters/project_id"
22192+
},
22193+
{
22194+
"$ref": "#/components/parameters/webhook_id"
22195+
},
22196+
{
22197+
"$ref": "#/components/parameters/response_status_codes"
22198+
}
22199+
],
22200+
"responses": {
22201+
"200": {
22202+
"description": "OK",
22203+
"content": {
22204+
"application/json": {
22205+
"schema": {
22206+
"type": "array",
22207+
"items": {
22208+
"$ref": "#/components/schemas/webhook_delivery"
22209+
}
22210+
}
22211+
}
22212+
},
22213+
"headers": {
22214+
"X-Rate-Limit-Limit": {
22215+
"$ref": "#/components/headers/X-Rate-Limit-Limit"
22216+
},
22217+
"X-Rate-Limit-Remaining": {
22218+
"$ref": "#/components/headers/X-Rate-Limit-Remaining"
22219+
},
22220+
"X-Rate-Limit-Reset": {
22221+
"$ref": "#/components/headers/X-Rate-Limit-Reset"
22222+
},
22223+
"Link": {
22224+
"$ref": "#/components/headers/Link"
22225+
}
22226+
}
22227+
},
22228+
"400": {
22229+
"$ref": "#/components/responses/400"
22230+
},
22231+
"404": {
22232+
"$ref": "#/components/responses/404"
22233+
},
22234+
"429": {
22235+
"$ref": "#/components/responses/429"
22236+
}
22237+
},
22238+
"x-code-samples": [
22239+
{
22240+
"lang": "Curl",
22241+
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/webhooks/:webhook_id/deliveries?response_status_codes=401%2C404\" \\\n -u USERNAME_OR_ACCESS_TOKEN"
22242+
},
22243+
{
22244+
"lang": "CLI v2",
22245+
"source": "phrase webhooks list \\\n--project_id <project_id> \\\n--webhook_id <webhook_id> \\\n--access_token <token>"
22246+
}
22247+
]
22248+
}
22249+
},
22250+
"/projects/{project_id}/webhooks/{webhook_id}/deliveries/{id}": {
22251+
"get": {
22252+
"summary": "Get a single webhook delivery",
22253+
"description": "Get all information about a single webhook delivery for the given ID.",
22254+
"operationId": "webhook_deliveries/show",
22255+
"tags": [
22256+
"Webhook Deliveries"
22257+
],
22258+
"parameters": [
22259+
{
22260+
"$ref": "#/components/parameters/X-PhraseApp-OTP"
22261+
},
22262+
{
22263+
"$ref": "#/components/parameters/project_id"
22264+
},
22265+
{
22266+
"$ref": "#/components/parameters/webhook_id"
22267+
},
22268+
{
22269+
"$ref": "#/components/parameters/id"
22270+
}
22271+
],
22272+
"responses": {
22273+
"200": {
22274+
"description": "OK",
22275+
"content": {
22276+
"application/json": {
22277+
"schema": {
22278+
"$ref": "#/components/schemas/webhook_delivery"
22279+
}
22280+
}
22281+
},
22282+
"headers": {
22283+
"X-Rate-Limit-Limit": {
22284+
"$ref": "#/components/headers/X-Rate-Limit-Limit"
22285+
},
22286+
"X-Rate-Limit-Remaining": {
22287+
"$ref": "#/components/headers/X-Rate-Limit-Remaining"
22288+
},
22289+
"X-Rate-Limit-Reset": {
22290+
"$ref": "#/components/headers/X-Rate-Limit-Reset"
22291+
},
22292+
"Link": {
22293+
"$ref": "#/components/headers/Link"
22294+
}
22295+
}
22296+
},
22297+
"400": {
22298+
"$ref": "#/components/responses/400"
22299+
},
22300+
"404": {
22301+
"$ref": "#/components/responses/404"
22302+
},
22303+
"429": {
22304+
"$ref": "#/components/responses/429"
22305+
}
22306+
},
22307+
"x-code-samples": [
22308+
{
22309+
"lang": "Curl",
22310+
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/webhooks/:webhook_id/deliveries/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN"
22311+
},
22312+
{
22313+
"lang": "CLI v2",
22314+
"source": "phrase webhook deliveries show \\\n--project_id <project_id> \\\n--webhook_id <webhook_id> \\\n--id <delivery_id> \\\n--access_token <token>"
22315+
}
22316+
]
22317+
}
22318+
},
22319+
"/projects/{project_id}/webhooks/{webhook_id}/deliveries/{id}/redeliver": {
22320+
"post": {
22321+
"summary": "Redeliver a single webhook delivery",
22322+
"description": "Trigger an individual webhook delivery to be redelivered.",
22323+
"operationId": "webhook_deliveries/redeliver",
22324+
"tags": [
22325+
"Webhook Deliveries"
22326+
],
22327+
"parameters": [
22328+
{
22329+
"$ref": "#/components/parameters/X-PhraseApp-OTP"
22330+
},
22331+
{
22332+
"$ref": "#/components/parameters/project_id"
22333+
},
22334+
{
22335+
"$ref": "#/components/parameters/webhook_id"
22336+
},
22337+
{
22338+
"$ref": "#/components/parameters/id"
22339+
}
22340+
],
22341+
"responses": {
22342+
"200": {
22343+
"description": "OK",
22344+
"content": {
22345+
"application/json": {
22346+
"schema": {
22347+
"$ref": "#/components/schemas/webhook_delivery"
22348+
}
22349+
}
22350+
},
22351+
"headers": {
22352+
"X-Rate-Limit-Limit": {
22353+
"$ref": "#/components/headers/X-Rate-Limit-Limit"
22354+
},
22355+
"X-Rate-Limit-Remaining": {
22356+
"$ref": "#/components/headers/X-Rate-Limit-Remaining"
22357+
},
22358+
"X-Rate-Limit-Reset": {
22359+
"$ref": "#/components/headers/X-Rate-Limit-Reset"
22360+
},
22361+
"Link": {
22362+
"$ref": "#/components/headers/Link"
22363+
}
22364+
}
22365+
},
22366+
"400": {
22367+
"$ref": "#/components/responses/400"
22368+
},
22369+
"404": {
22370+
"$ref": "#/components/responses/404"
22371+
},
22372+
"429": {
22373+
"$ref": "#/components/responses/429"
22374+
}
22375+
},
22376+
"x-code-samples": [
22377+
{
22378+
"lang": "Curl",
22379+
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/webhooks/:webhook_id/deliveries/:id/redeliver\" \\\n -u USERNAME_OR_ACCESS_TOKEN"
22380+
},
22381+
{
22382+
"lang": "CLI v2",
22383+
"source": "phrase webhook deliveries show \\\n--project_id <project_id> \\\n--webhook_id <webhook_id> \\\n--id <delivery_id> \\\n--access_token <token>"
22384+
}
22385+
]
22386+
}
2212622387
}
2212722388
}
2212822389
}

main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ tags:
249249
- name: Variables
250250
- name: Versions / History
251251
- name: Webhooks
252+
- name: Webhook Deliveries
252253

253254
x-tagGroups:
254255
- name: Core Resources

parameters.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,17 @@ per_page:
150150
schema:
151151
type: integer
152152
example: 25
153+
webhook_id:
154+
in: path
155+
name: webhook_id
156+
description: Webhook ID
157+
required: true
158+
schema:
159+
type: string
160+
response_status_codes:
161+
in: query
162+
name: response_status_codes
163+
description: List of Response Status Codes
164+
required: false
165+
schema:
166+
type: string

paths.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,3 +580,12 @@
580580
"$ref": "./paths/job_comments/index.yaml"
581581
post:
582582
"$ref": "./paths/job_comments/create.yaml"
583+
"/projects/{project_id}/webhooks/{webhook_id}/deliveries":
584+
get:
585+
"$ref": "./paths/webhook_deliveries/index.yaml"
586+
"/projects/{project_id}/webhooks/{webhook_id}/deliveries/{id}":
587+
get:
588+
"$ref": "./paths/webhook_deliveries/show.yaml"
589+
"/projects/{project_id}/webhooks/{webhook_id}/deliveries/{id}/redeliver":
590+
post:
591+
"$ref": "./paths/webhook_deliveries/redeliver.yaml"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
summary: List webhook deliveries
3+
description: List all webhook deliveries for the given webhook_id.
4+
operationId: webhook_deliveries/list
5+
tags:
6+
- Webhook Deliveries
7+
parameters:
8+
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
9+
- "$ref": "../../parameters.yaml#/project_id"
10+
- "$ref": "../../parameters.yaml#/webhook_id"
11+
- "$ref": "../../parameters.yaml#/response_status_codes"
12+
13+
responses:
14+
'200':
15+
description: OK
16+
content:
17+
application/json:
18+
schema:
19+
type: array
20+
items:
21+
"$ref": "../../schemas/webhook_delivery.yaml#/webhook_delivery"
22+
headers:
23+
X-Rate-Limit-Limit:
24+
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit"
25+
X-Rate-Limit-Remaining:
26+
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining"
27+
X-Rate-Limit-Reset:
28+
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset"
29+
Link:
30+
"$ref": "../../headers.yaml#/Link"
31+
'400':
32+
"$ref": "../../responses.yaml#/400"
33+
'404':
34+
"$ref": "../../responses.yaml#/404"
35+
'429':
36+
"$ref": "../../responses.yaml#/429"
37+
x-code-samples:
38+
- lang: Curl
39+
source: |-
40+
curl "https://api.phrase.com/v2/projects/:project_id/webhooks/:webhook_id/deliveries?response_status_codes=401%2C404" \
41+
-u USERNAME_OR_ACCESS_TOKEN
42+
- lang: CLI v2
43+
source: |-
44+
phrase webhooks list \
45+
--project_id <project_id> \
46+
--webhook_id <webhook_id> \
47+
--access_token <token>

0 commit comments

Comments
 (0)