First Steps with the OVHcloud APIs
Learn how to use OVHcloud APIs
Learn how to use OVHcloud APIs
Last updated 30th May 2022
The APIs available on https://ca.api.ovh.com/ allow you to purchase, manage, update and configure OVHcloud products without using a graphical interface such as the Control Panel.
Learn how to use OVHcloud APIs and how to pair them with your applications.
You have an active OVHcloud account and know its credentials.
You are on the OVHcloud API web page.
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.
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” section of this guide.
On the OVHcloud API page, click
Explore the OVH API to view the list of APIs.
To use the APIs on your products, you must sign in to this site using your OVHcloud credentials.
Loginin the upper right.
If your OVHcloud account is protected by two-factor authentication, you will also need to enter the code generated by SMS or OTP mobile application or U2F key.
Once logged in, you will see a list of OVHcloud products that can be managed with APIs. This list is sorted alphabetically.
For example, to view the domain name APIs, click /domain in the list.
After you click the product, a list of the product's APIs appears below.
There are 4 types of APIs available that use what are called HTTP methods:
The GET method is used to retrieve data from a resource.
For example, to retrieve a list of your domain names, use the following API:
The POST method is used to send additional data to the resource.
For example, to add a record to your DNS zone, use the following API:
The PUT method is used to replace the current data in the resource with the data in the query.
For example, if you have mistakenly set a record in your DNS zone, use the following API:
The DELETE method is used to delete the called resource.
For example, if you do not want to keep the DNS record that you added to your DNS zone, use the following API:
After you click the API you want, the Parameters section allows you to assign variables for its application.
For example, when adding a TXT record to your DNS zone, you will optimise the following settings:
Once you have set the parameters, you can launch the API by clicking
Result tab displayed will give you the API execution report.
Python tabs contain the elements to be added to your script according to the language used.
Any application that wants to communicate with the OVHcloud API must be declared in advance.
To do this, click the following link: https://ca.api.ovh.com/createToken/.
Fill in your OVHcloud customer ID, password, and application name. The name will be useful later if you want to allow others to use it.
You can also add a description of the application and a validity period.
Rights field allows you to restrict the use of the application to certain APIs.
In order to allow all OVHcloud APIs for an HTTP method, put an asterisk (
*) into the field, as in the following example where the GET method is allowed for all APIs:
After you click
Create keys, you will be issued three keys:
In this case, the CK key is attached to your account.
The CK token can be used for rights delegation. See the following guide for more information: How to manage a customer’s account via OVHcloud API
Once you have obtained your three keys (AK, AS, CK), you can sign API requests. The signature is calculated as follows:
"$1$" + SHA1_HEX(AS+"+"+CK+"+"+METHOD+"+"+QUERY+"+"+BODY+"+"+TSTAMP)
To simplify the development of your applications, OVHcloud provides API wrappers in multiple languages. Using them will help you to avoid worrying about signing requests, so that you can focus on developing your application.
Here is an example of how to use the
/me section to manage your OVHcloud account:
import ovh # Instantiate. Visit https://ca.api.ovh.com/createToken/?GET=/me # to get your credentials client = ovh.Client( endpoint='ovh-eu', application_key='<application key>', application_secret='<application secret>', consumer_key='<consumer key>', ) # Print nice welcome message print("Welcome", client.get('/me')['firstname'])
Join our community of users on https://community.ovh.com/en/.
Please feel free to give any suggestions in order to improve this documentation.
Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.
Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.
Thank you. Your feedback has been received.
Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.Discuss with the OVHcloud community