Making Your First Call
Let's make a simple request to retrieve a list of available products. This is a great way to verify that your authentication is working correctly.
You'll need two things for this request:
- Your API Key.
- A unique Request ID (a version 4 UUID), which you'll generate for every request.
The X-Request-ID header is required on all endpoints. It allows us to trace a specific request and is essential for troubleshooting if you ever need support.
Request: Get Products
Using a command-line tool like cURL, you can make a GET request to the /products endpoint in our UAT environment.
curl -X GET '[https://api-uat.megsapp.com/api/v2/products](https://api-uat.megsapp.com/api/v2/products) '\
-H 'Authorization: Bearer YOUR\_API\_KEY'\
-H 'X-Request-ID: YOUR\_UNIQUE\_UUID'
Don't forget to replace:
- YOUR_API_KEY with your actual Bearer Token.
- YOUR_UNIQUE_UUID with a newly generated UUID (e.g., 123e4567-e89b-12d3-a456-426614174000).
Successful Response
If your request is successful, you'll receive a 200 OK status code and a JSON object containing a list of products.
Congratulations! You've just made your first successful API call.
Updated 4 months ago