I tried to grab list of my domains on OVH account.
I tried code as bellow
library(httr)
library(dplyr)
library(jsonlite)
urlAPI <- "https://ca.api.ovh.com/v1/domain"
GETendpoint <- "endpoint=ovh-eu"
GETappKey <- "&application_key=XX"
GETappSecret <- "&application_secret=XX"
GETconsKey <- "&consumer_key=XX"
urlGET <- paste(urlAPI, "?", GETendpoint, GETappKey,GETappSecret,GETconsKey, sep = "")
OVH <-
GET(
urlGET
)
GET_OVH <-OVH %>% content("text") %>% fromJSON(flatten = F)
This gives me response
[1] "You must login first"
How can i login and grab data from OVH account?
I don't have an account at that site so I can't really test, but looking at the documentation and code samples they provide, it seems you need to sign your requests with a sha1 signature. I don't know of any built in methods for this. Assuming you've created your applications keys as described here https://help.ovhcloud.com/csm/en-ca-api-getting-started-ovhcloud-api?id=kb_article_view&sysparm_article=KB0029722#advanced-usage-pair-ovhcloud-apis-with-an-application
Here's a reference function that will implement signing that seems inline with their documentation
This function returns an object with GET and POST methods to take care of the signing. So you would use it like