Salesforce backup and restore for data, files and metadata
Post Reply
Henrik.Grevelund
Service Provider
Posts: 180
Liked: 28 times
Joined: Feb 13, 2017 2:56 pm
Full Name: Henrik Grevelund
Contact:

API and Swagger

Post by Henrik.Grevelund » 1 person likes this post

Hi,

I know that the API is unsupported, so i probably can't open a support case when swagger doesn't work.
So i was hoping we could start a tread in here to help each other.

With swagger i am able to authorize and get the token. I can enter the token in swagger so it shows the lock as closed.
But when i try to test any other call, the only answer i get is this:

Code: Select all

{
  "path": "/api/v1/backup/job",
  "trace": "73894294c6da8fed",
  "status_description": "Unauthorized",
  "timestamp_utc": "2025-05-08T18:27:46.503",
  "method": "GET",
  "error_code": null,
  "message": "Full authentication is required to access this resource",
  "errors": [
    {
      "code": "authError",
      "user_message": "Full authentication is required to access this resource",
      "object_name": null,
      "context": null
    }
  ],
  "timestamp": "2025-05-08T18:27:46.503Z",
  "status": 401
}
If i try to use postman i dont get the authentication error.
I get another error when trying to get the list of companies.

Swagger says this is needed to get the company list:

Code: Select all

curl -X 'GET' \
  'https://severname/api/v1/company?page=0&size=256&sort_fields=id' \
  -H 'accept: application/json' \
  -H 'Authorization: REMOVED TOKEN'
Request URL
https://servername/api/v1/company?page=0&size=256&sort_fields=id
So only a header and the URL. But when i try that in postman i get this error:

Code: Select all

{
    "path": "/api/v1/company",
    "trace": "21ea89ad5c474ae9",
    "status_description": "Unprocessable Entity",
    "timestamp_utc": "2025-05-08T18:39:51.622",
    "method": "POST",
    "error_code": null,
    "message": "E4RT: Unexpected parameter value: Required request body is missing: public org.springframework.http.ResponseEntity<com.veeam.vbsf.model.generated.CompanyPostResponse> com.veeam.vbsf.controllers.v1.CompanyV1Controller.companyPostRequest(com.veeam.vbsf.model.generated.CompanyPostRequest)",
    "errors": [
        {
            "code": "E4RT",
            "user_message": "E4RT: Unexpected parameter value: Required request body is missing: public org.springframework.http.ResponseEntity<com.veeam.vbsf.model.generated.CompanyPostResponse> com.veeam.vbsf.controllers.v1.CompanyV1Controller.companyPostRequest(com.veeam.vbsf.model.generated.CompanyPostRequest)",
            "object_name": null,
            "context": null
        }
    ],
    "timestamp": "2025-05-08T18:39:51.622Z",
    "status": 422
}
So what is needed in the body ?
Have nice day,
Henrik
anastasia.belyaeva
Veeam Software
Posts: 31
Liked: 12 times
Joined: Mar 14, 2023 9:05 am
Full Name: Anastasia Belyaeva
Contact:

Re: API and Swagger

Post by anastasia.belyaeva »

Hello, @Henrik.Grevelund

1) When you authorise in swagger, please specify value as: Bearer TOKEN.

2) For Postman I see you copied result of POST request. In that case body should include "name" attribute of the new company.
In case of GET, request body is not needed.

regards.
MIvanov
VP, Product Management
Posts: 290
Liked: 78 times
Joined: Dec 12, 2008 2:39 pm
Full Name: Maxim
Contact:

Re: API and Swagger

Post by MIvanov »

Authorization: Bearer %token_value%
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest