How to send API requests

Code examples

After receiving your API account credentials, you can browse and test Truugo API requests via Swagger UI.

API request using cURL

The following sample request uses cURL to validate a message using Validation API:

curl -X 'POST' 'https://<api_host>/validator/get-report'
  -H 'accept: application/json'
  -H 'authorization: Basic <access_token>'
  -F 'instance=@/path/to/file/to/be/validated.xml'
  -F 'profile_key=<profile_key>'

The profile_key parameter identifies the test profile to be used for validating the message instance provided as the instance parameter. The <access_token> is a base64 encoded string built of your API account credentials (username:password).

Use the API request '/validator/list-profiles' to get the list of test profiles you have a granted access.

API request using Postman

API request param using Postman

Provide request parameters in the body as "form-data". Change the type of 'instance' parameter from the default value (String) to File.