Using the My2Cloud API (Swagger)

Modified on Wed, 15 Jul at 2:50 PM

My2Cloud publishes an interactive API reference (Swagger UI) where you can browse every endpoint and run it live against your own account. This guide shows how to open it, sign in for a token, and make a call.

Before you start. You need a My2Cloud login with API access. You call the API as yourself, so you only ever see the data your account is permitted to see. Do not share access tokens - anyone holding one can act as you until it expires.

1. Open the Swagger UI

Browse to /swagger on your My2Cloud address:

  • Tenant users: https://<your-company>.my2cloud.net:44301/swagger
  • Host administrators: https://my2cloud.net:44301/swagger

The address you use sets which organisation you sign in to, so always use your own company's subdomain. You will see the API title, an Authorize button, and the list of endpoints grouped by area.

https://acme.my2cloud.net:44301/swagger/index.html
My2Cloud Portal APIv1? Authorize
POST/api/TokenAuth/AuthenticateSign in and get a token
GET/api/services/app/Session/GetCurrentLoginInformations?
GET/api/services/app/Veeam/GetCompanies?
Illustration: the Swagger landing page. The padlock on an endpoint means it needs a token.

2. Get an access token

  1. Expand POST /api/TokenAuth/Authenticate and click Try it out.
  2. In the request body, enter your userNameOrEmailAddress and password.
  3. Click Execute.
  4. In the response, copy the value of result.accessToken.
POST/api/TokenAuth/AuthenticateTry it out
Request body
{  "userNameOrEmailAddress": "you@acme.com",  "password": "••••••••" }
Execute
Server response
200
{  "result": {    "accessToken": "eyJhbGciOiJod… (copy this)",    "encryptedAccessToken": "…",    "expireInSeconds": 86400,    "userId": 42  },  "success": true }
Illustration: the Authenticate endpoint returns your access token in result.accessToken.

3. Authorize Swagger with your token

  1. Click the Authorize button (the padlock, top right).
  2. In the value box, enter Bearer followed by the token you copied, for example Bearer eyJhbGciOiJ…
  3. Click Authorize, then Close. The padlocks now show as locked/closed, meaning your calls are authenticated.
Illustration: the Authorize dialog. Paste Bearer <token> into the value box.
Tip. Some browsers pre-fill the Bearer word for you - if so, paste just the token. If a call returns 401 Unauthorized, your token has expired: repeat steps 2 and 3 for a fresh one.

4. Call an endpoint

  1. Expand any endpoint (for example a GET under one of the service groups).
  2. Click Try it out, fill in any parameters, and click Execute.
  3. Read the Server response: the HTTP status, the JSON body, and the exact curl command Swagger used (handy for scripting).
GET/api/services/app/Veeam/GetCompanies?
Execute
Server response
200
{  "result": {    "companies": [      { "instanceUid": "…", "name": "Acme Ltd" }    ]  },  "success": true }
Illustration: a successful call returns a 200 with the JSON result.

Useful to know

  • Raw specification. The machine-readable OpenAPI document is at /swagger/v1/swagger.json - import it into Postman, Insomnia or a code generator.
  • Your permissions apply. Endpoints and data are limited to what your account can access; a filtered user only sees their permitted accounts.
  • Tokens expire. Re-authenticate when you get a 401. Treat tokens like passwords - never paste them into shared documents or tickets.
  • Right address. If endpoints return no data, check you opened Swagger on your own company's subdomain.

Troubleshooting

  • 401 Unauthorized - not authorized, or the token expired. Redo steps 2 and 3.
  • The Authorize dialog keeps the padlock open - the value must be Bearer <token>; check for stray spaces or a missing/extra Bearer.
  • The page will not load - confirm the address and port (:44301) and that you can reach the portal normally. If it persists, raise a ticket with the address you used and a screenshot.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article