How to export cookies via Postman
The Cookie Export endpoint in Postman is a powerful tool for automation users, allowing you to extract cookies from profiles using folder_id
and profile_id
. This guide walks you through the process step-by-step, ensuring you can seamlessly integrate cookie export into your automation workflows.
Prerequisites
Before you begin, complete the following setup:
- Configure Postman Authentication: Follow the three steps outlined in How to Set Up Indigo X API with Postman, including the "Configure the Bearer Token for Requests" section, to ensure proper sign-in.
- Gather Required IDs: You’ll need the
folder_id
andprofile_id
for the profile you want to export cookies from. If you need help, refer to Retrieving Profile, Folder, and Workspace IDs.
Step-by-Step Guide to Export Cookies
Follow these steps to export cookies using the Cookie Export endpoint in Postman.
1. Locate the Cookie Export Endpoint
- Open Postman.
- Navigate to the "Launcher" folder in your workspace.
- Select the "Cookie Export" endpoint. For detailed documentation, see the Cookie Export Endpoint Reference.
2. Configure the Request
In the request body, provide the required parameters:
folder_id
: The ID of the folder containing the profile.profile_id
: The ID of the profile from which to export cookies.
Example request body:
{
"folder_id": "your_folder_id",
"profile_id": "your_profile_id"
}
If you’re unsure how to find folder_id
or profile_id
, check out the Retrieving IDs Guide for a quick walkthrough.
3. Send the Request
- Click the "Send" button in Postman to execute the request.
- Check the response status:
- A 200 OK status indicates a successful request.
- If you encounter errors, verify your authentication setup or input parameters.
4. Process the Response
The response will contain the exported cookies in the following structure:
{
"data": {
"cookies": "[{...}]"
}
}
The cookies
value is returned as a string wrapped in extra quotes, which is not a valid JSON array. To use the cookies, you need to convert this string into a proper JSON format.
Steps to Fix the Cookies Format
- Copy the Cookies Value: Copy the entire
cookies
value (including the content inside the quotes). - Remove Outer Quotes: Manually remove the outer quotes to transform the string into a JSON array.
- Optional - Use a JSON Formatter: For a quick fix, paste the cookies string into a tool like JSON Fixer. This will instantly format the data into a clean JSON array.
Ensure the cookies are in a valid JSON array format before using them in your automation scripts or other tools.