Get the workspace of the API key
Useful to check that a key works.
GET
/
workspace
Get the workspace of the API key
curl --request GET \
--url https://app.hocdoc.com/api/v1/workspace \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.hocdoc.com/api/v1/workspace', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hocdoc.com/api/v1/workspace"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"id": "9f1c4b7e-3a52-4d86-b0c1-7e2a9d5f3c18",
"name": "Example GmbH",
"timezone": "Europe/Berlin",
"currency": "EUR"
}
}{
"error": {
"code": "invalid_request",
"message": "Query string too long."
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key."
}
}{
"error": {
"code": "method_not_allowed",
"message": "Method not allowed. This API is read-only."
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests."
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error."
}
}⌘I
Get the workspace of the API key
curl --request GET \
--url https://app.hocdoc.com/api/v1/workspace \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.hocdoc.com/api/v1/workspace', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hocdoc.com/api/v1/workspace"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"id": "9f1c4b7e-3a52-4d86-b0c1-7e2a9d5f3c18",
"name": "Example GmbH",
"timezone": "Europe/Berlin",
"currency": "EUR"
}
}{
"error": {
"code": "invalid_request",
"message": "Query string too long."
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key."
}
}{
"error": {
"code": "method_not_allowed",
"message": "Method not allowed. This API is read-only."
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests."
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error."
}
}