Skip to content

Commit 5060b3a

Browse files
committed
EN Add new console documentation
1 parent f828e59 commit 5060b3a

File tree

1 file changed

+177
-0
lines changed

1 file changed

+177
-0
lines changed
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
title: 'Exploring the OVHcloud APIs'
3+
slug: ovh-api-exploration
4+
excerpt: 'Discover how to explore the OVHcloud APIs'
5+
section: 'First steps'
6+
updated: 2023-03-27
7+
---
8+
9+
**Last updated March 27th 2023**
10+
11+
## Objective
12+
13+
The APIs available on [https://eu.api.ovh.com/](https://eu.api.ovh.com/){.external} allow you to purchase, manage, update and configure OVHcloud products without using a graphical interface such as the Control Panel.
14+
15+
**Discover how to explore the OVHcloud APIs on our brand new console**
16+
17+
## Requirements
18+
19+
- You have an active OVHcloud account and know its credentials.
20+
- You are on the [OVHcloud API](https://eu.api.ovh.com/){.external} web page.
21+
22+
## Instructions
23+
24+
> [!warning]
25+
> OVHcloud is providing you with services for which you are responsible, with regard to their configuration and management. You are therefore responsible for ensuring they function correctly.
26+
>
27+
> This guide is designed to assist you in common tasks as much as possible. Nevertheless, we recommend contacting a specialised provider and/or the software publisher for the service if you encounter any difficulties. We will not be able to assist you ourselves. You can find more information in the [“Go further”](#gofurther) section of this guide.
28+
>
29+
30+
### Simple Use
31+
32+
#### Sign in to OVHcloud APIs
33+
34+
On the [OVHcloud API](https://eu.api.ovh.com/) page, click `Try the new OVHcloud API console`{.action} to view the list of APIs.
35+
36+
To use the APIs on your products, you must sign in to this site using your OVHcloud credentials.
37+
38+
- Click `Authentication`{.action} in the upper left.
39+
- The authentication process uses OAuth2 protocol with scopes. To authenticate yourself, you have to choose at least one scope from the list. A scope will limit the access of the generated token to a subset of the API operations. For this tutorial, simply select the scope `all` that allows all API operations, then click on `GET TOKEN`.
40+
- You will be redirected to the OVHcloud authentication page on which you need to enter your OVHcloud credentials.
41+
- Once your credentials validated, you will be redirected on the API console and will be able to try calls.
42+
43+
![API](images/authentication.png){.thumbnail}
44+
45+
> [!primary]
46+
>
47+
> If your OVHcloud account is protected by [two-factor authentication](https://docs.ovh.com/us/en/customer/secure-account-with-2FA/), you will also need to enter the code generated by SMS or OTP mobile application or U2F key.
48+
>
49+
50+
#### Explore the available products on OVHcloud APIs
51+
52+
##### API branch selection
53+
54+
Several branches of OVHcloud APIs are available:
55+
- **V1**: the API available at [https://eu.api.ovh.com/v1](https://eu.api.ovh.com/v1)
56+
- **V2**: the new OVHcloud API, available at [https://eu.api.ovh.com/v2](https://eu.api.ovh.com/v2)
57+
58+
The API branch can be selected using the drop-down menu in the upper left.
59+
60+
![API](images/api-branches.png){.thumbnail}
61+
62+
##### API section selection
63+
64+
Once you have chosen an API branch, you can browse the different sections of the selected branch. The sections are sorted in alphabetical order and by default the first section is displayed.
65+
66+
You can choose a section in the drop-down menu just next to the branch-selection one. It is possible to filter out the list of sections by typing the name of the desired section.
67+
68+
![API](images/api-section.png){.thumbnail}
69+
70+
Once you have selected an API section, the operations it contains are displayed in the left menu.
71+
72+
##### Exploring the operations
73+
74+
The list of operations of the selected API section is displayed in the lower part of the left menu.
75+
76+
![API](images/api-operations.png){.thumbnail}
77+
78+
Each line contains the following pieces of information:
79+
- HTTP verb of the operation (GET, PUT, POST, PATCH, DELETE)
80+
- Path of the operation
81+
- Operation's state: if the operation is in state *alpha* or *beta*, you will see a badge on the right of the operation's path.
82+
83+
![API](images/operation-beta.png){.thumbnail}
84+
85+
If the operation is deprecated, the path will be greyed out in the list of operations. In the following example, the second operation is deprecated.
86+
87+
![API](images/operation-deprecated.png){.thumbnail}
88+
89+
Once you selected an operation, its detailed information will be displayed on the right side of the page.
90+
91+
This view is divided in four subsections described below.
92+
93+
###### General information
94+
95+
This subsection contains basic information about the operation:
96+
- State of the operation (e.g. *Beta version*)
97+
- Description of the operation
98+
- Path of the operation and HTTP verb
99+
100+
![API](images/operation-information.png){.thumbnail}
101+
102+
###### Request
103+
104+
This subsection describes the input parameters of the operation. Depending of the operation's parameters, the following information will be displayed:
105+
106+
**Path parameters**
107+
108+
![API](images/operation-path-parameter.png){.thumbnail}
109+
110+
The red star located on the left of the parameter's name indicates that this parameter is mandatory to be able to execute the request.
111+
112+
**Header parameters**
113+
114+
![API](images/operation-header-parameter.png){.thumbnail}
115+
116+
**Query parameters**
117+
118+
![API](images/operation-query-parameter.png){.thumbnail}
119+
120+
**Request body**
121+
122+
This subsection describes the request body. The default view shows an example body that can be used in a request.
123+
These values can be modified directly in place to try the call with values corresponding to your services.
124+
125+
![API](images/operation-request-body.png){.thumbnail}
126+
127+
There is also a tab *SCHEMA* that exposes the details of type, description, et allowed values for each parameter.
128+
129+
![API](images/operation-request-schema.png){.thumbnail}
130+
131+
###### Response
132+
133+
This section is similar to the previous one and describes the operation's response.
134+
135+
![API](images/operation-response.png){.thumbnail}
136+
137+
The *SCHEMA* tab is also available to get the details of the returned fields alongside their description.
138+
139+
![API](images/operation-response-schema.png){.thumbnail}
140+
141+
##### Advanced search
142+
143+
An advanced search is available by clicking on the `Search` button in the upper left.
144+
145+
![API](images/api-advance-search.png){.thumbnail}
146+
147+
When clicking on this button, a popup is opened allowing to search through operation with the following criterias:
148+
- Path of the operation
149+
- Description of the API route
150+
- Parameters of the operation
151+
- Fields of the operations's request body
152+
- Description of the operation's response
153+
- State of the operation
154+
155+
![API](images/api-advance-search-popup.png){.thumbnail}
156+
157+
#### Execute requests
158+
159+
From the console, it is possible to interact directly with the API using the `TRY` button.
160+
161+
![API](images/operation-try-call.png){.thumbnail}
162+
163+
After having set all the required parameters (when necessary), this button allows you to make a real call to the OVHcloud API.
164+
When executing the request, the API response is displayed below the operation parameters.
165+
166+
Three tabs are then available:
167+
- **RESPONSE**: response body of the API
168+
- **RESPONSE HEADERS**: headers returned by the API
169+
- **CURL**: show the equivalent of the request using the tool `curl`
170+
171+
## Go further <a name="gofurther"></a>
172+
173+
[Managing a Domain Name with the OVHcloud API](https://docs.ovh.com/us/en/domains/api/)
174+
175+
[How to manage a customer’s account via OVHcloud API](https://docs.ovh.com/us/en/api/api-rights-delegation/)
176+
177+
Join our community of users on <https://community.ovh.com/en/>.

0 commit comments

Comments
 (0)