Skip to content

Commit cb7d95a

Browse files
committed
Add /ping endpoint
1 parent 09d5086 commit cb7d95a

File tree

4 files changed

+73
-3
lines changed

4 files changed

+73
-3
lines changed

docs.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@
118118
"group": "Balance",
119119
"pages": ["reference/2024-02-05/endpoint/balance/get"]
120120
},
121+
{
122+
"group": "Utility",
123+
"pages": ["reference/2024-02-05/endpoint/utility/ping"]
124+
},
121125
{
122126
"group": "Webhooks",
123127
"pages": [

getting-started/api-key.mdx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description: "Create an API key to authenticate your requests"
1414

1515
</Step>
1616
<Step title="Choose the environment">
17-
You now need to choose the environment to create the API key in. For this guide we will use the playground environment.
17+
You now need to choose the environment to create the API key in. For this guide we will use the **playground** environment.
1818
<Frame caption="The environment modal is displayed when you click the 'Create new API key' button.">
1919
![](/assets/screenshots/api-key-page-env-modal.png)
2020
</Frame>
@@ -31,7 +31,7 @@ description: "Create an API key to authenticate your requests"
3131
![](/assets/screenshots/api-key-page-created.png)
3232
</Frame>
3333
<Note>
34-
#### Securing your API key
34+
**Securing your API key**
3535

3636
It is your responsibility to keep your API keys safe and secure. Anyone holding your key will be able to make requests to the API on your behalf.
3737
Review our [security best practices](/best-practices/security) for information on how to keep your API keys secure.
@@ -48,14 +48,39 @@ Once you have created an API key you can view it on the [API keys page](https://
4848
![](/assets/screenshots/api-key-page-success.png)
4949
</Frame>
5050

51-
## Using the API key
51+
## Using your API key
52+
53+
### The API key header
5254

5355
When making requests to the API you will need to include the API key in the request headers. It must be included in the `X-Api-Key` header for all requests.
5456

5557
```http
5658
X-Api-Key: YOUR_API_KEY
5759
```
5860

61+
### Testing your API key
62+
63+
You can verify that your API key is working correctly by making a request to the [ping endpoint](/reference/2024-02-05/endpoint/utility/ping). This is a simple health check endpoint that requires authentication but doesn't perform any other operations.
64+
65+
```bash
66+
curl -X GET https://playground.runa.io/v2/ping \
67+
-H "X-Api-Key: YOUR_API_KEY"
68+
```
69+
70+
If your API key is valid, you'll receive this response:
71+
72+
```json
73+
{
74+
"message": "pong"
75+
}
76+
```
77+
78+
If you receive an error, check that:
79+
80+
- You've copied the entire API key correctly
81+
- You're using the correct environment URL (playground or production)
82+
- The API key hasn't been revoked
83+
5984
<br />
6085
<Card
6186
horizontal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Ping"
3+
openapi: "/reference/2024-02-05/openapi.json GET /ping"
4+
---
5+
6+
Use the ping endpoint to validate your integration can connect to the Runa API. If you receive a `200 OK` response you have made a successful call to the API with a valid API key.

reference/2024-02-05/openapi.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
}
3030
],
3131
"tags": [
32+
{
33+
"name": "utility",
34+
"description": "Utility endpoints."
35+
},
3236
{
3337
"name": "balance",
3438
"description": "Operations related to account balance."
@@ -43,6 +47,37 @@
4347
}
4448
],
4549
"paths": {
50+
"/ping": {
51+
"get": {
52+
"operationId": "ping",
53+
"tags": ["utility"],
54+
"summary": "Ping endpoint",
55+
"description": "Check your integration can connect to the Runa API",
56+
"parameters": [{ "$ref": "#/components/parameters/X-Api-Version" }],
57+
"responses": {
58+
"200": {
59+
"description": "OK",
60+
"content": {
61+
"application/json": {
62+
"schema": {
63+
"type": "object",
64+
"properties": {
65+
"message": {
66+
"type": "string",
67+
"example": "pong"
68+
}
69+
},
70+
"required": ["message"]
71+
},
72+
"example": {
73+
"message": "pong"
74+
}
75+
}
76+
}
77+
}
78+
}
79+
}
80+
},
4681
"/balance": {
4782
"get": {
4883
"operationId": "getBalance",

0 commit comments

Comments
 (0)