Knowledge Base

Making API requests

Making an API request

HTTP Requests

Use these components to construct HTTP requests to the Cloudmore API.

Parameter

Description

HTTP Method

GET – Request data from the API
POST – Submits data to the API
PUT – Updates all properties in a resource
PATCH – Update certain properties in a resource
DELETE – Deletes data in a resource

Base API URL

https://api.cloudmore.com

Path Parameters

A Broker or a Seller unique identifier needs to be provided as a path parameter: {baseApiUrl}/api/resellers/{resellerId}/organizations/

Other IDs are also provided as path parameters.

Query Parameters

Some API calls allow for query parameters to filter or limit the request data. For example:
?startDate=2023-01-01&endDate=2023-02-01

Each endpoint supports different query parameters.

Request Headers

Each API request needs to include the following headers:

Authorization: Bearer {token}
Content-type: application/json
Accept: application/json

In curl, you specify headers with the -h command.

Request Body

The request body is the data to submit with the API request. Some API endpoints require you to include JSON data in the request body.

In curl, you specify the data to submit with the -d command.

Example Requests:

Get all organizations under a broker
Bash
curl -X GET https://api.cloudmore.com/api/resellers/{resellerId}/Organizations \
-H 'Authorization: Bearer {token}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json'
Create a new organization
Bash
curl -X POST https://api.cloudmore.com/api/resellers/{resellerId}/Organizations \
-H 'Authorization: Bearer {token}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
 "name": "My Test Organization",
 "registrationNumber": "123456789",
 "vat": "123456789",
 "contact": {
 "name": "John Doe",
 "email": "john.doe@mytestorganization.com",
 "phone": "123456789",
 "cellPhone": "123456789"
 },
 "customerNumber": "123456789",
 "notificationEmail": "john.doe@mytestorganization.com",
 "address": {
 "street": "street 1",
 "postalCode": "12345",
 "city": "stockholm",
 "countryCode": "SE"
 },
 "primaryDomain": "mytestorganization.com"
}'

Retrieving API responses

Some Cloudmore API calls return data in JSON format within the response body.

For instance, when you send a GET request to the endpoint /api/resellers/{{resellerId}}/Organizations, the response includes detailed information about the organizations managed by the broker. This data can be used for integration, reporting, or synchronization with other systems.

Details listing the organizations under a broker
JSON
[
 {
 "id": "ff0eb40d-26f9-4cbb-b431-10fe66bc838e",
 "name": "My Test Organization 1",
 "displayName": "My Test Organization 1",
 "services": 2,
 "users": 1
 },
 {
 "id": "d0b55801-6cac-4221-a911-0712e78615c7",
 "name": "My Test Organization 2",
 "displayName": "My Test Organization 2",
 "services": 1,
 "users": 0
 },
 {
 "id": "a57a8428-80e6-4666-b549-c39873eef2ea",
 "name": "My Test Organization 3",
 "displayName": "My Test Organization 3",
 "services": 0,
 "users": 1
 }
]

Status and error codes

Cloudmore API uses HTTP status codes to indicate the success or failure of a request:

Status Code

Description

200 Success

The request succeeded.

201 Created

The request succeeded, and the resource was created.

204 No Content

The server processed the request successfully but did not return a response.

400 Bad Request

The API does not understand the request because of bad syntax. This could be because:

  • The request did not include a required parameter

  • The request parameter data was not in the correct format

  • The request parameters do not match the expected data types

401 Unauthorized

Authentication failed because credentials were missing or invalid.

403 Forbidden

The request failed because you did not have permission to perform the action or access the resource.

404 Not Found

The resource specified in the request does not exist. To resolve this error, make sure that the request
includes a valid resource.

405 Method Not Allowed

The method is not allowed for the resource specified in the request.

500 Server Error

An error occurred on the server.