Send Requests

1. Authorization

DocStar allows you to configure authentication for API requests through the Authorization tab. Before sending a request, you can choose an authentication type from the Type dropdown and provide the required credentials.

Copy of Copy of Untitled Design (10).png


Setting Up Authentication

  1. Open a request and navigate to the Authorization tab.

  2. Click on the Type dropdown to select an authentication method.

  3. Depending on the selected type, enter the necessary credentials.

  4. Once configured, click Send to authenticate and execute the request.

Available Authentication Methods in DocStar

  • No Auth – Sends the request without authentication.

  • Basic Auth – Requires a username and password.

  • OAuth 2.0 – Uses an access token for authentication.


2. Response Data and Cookies

After sending a request in DocStar, the Response section displays the API’s response, helping you analyze its status, body, headers, and cookies.

Viewing Response Data 

Once a request is sent, TechDoc provides a structured view of the response:
1. Status Code – Indicates whether the request was successful
2. Response Body – Displays the returned data in JSON, XML, or raw text format.
3. Headers – Shows metadata about the response, such as content type and caching policies.

Managing Cookies in DocStar 

Cookies play an important role in API authentication, session management, and state tracking. DocStar provides a Cookies section where you can view, add, and manage cookies associated with your requests.

1. Viewing Cookies

  • When an API response includes cookies, DocStar captures and displays them in the Cookies section.

2. Adding Cookies

  • DocStar allows users to manually add cookies for a specific domain.

  • To add a cookie:

    1. Go to the Cookies section.

    2. Enter the domain where the cookie should be applied.

    3. Click the Add button to create a new cookie entry.

    4. Define the cookie name, value, and any additional properties.

Copy of Copy of Untitled Design (11).png


3. Editing & Deleting Cookies

  • You can modify existing cookies to test different authentication or session behaviors.

  • Unwanted cookies can be deleted to reset API interactions.


3. Working with GraphQL

DocStar provides a dedicated interface for GraphQL requests, allowing users to send queries and mutations, explore API schemas, and define variables for dynamic requests.

Selecting GraphQL in DocStar

To enable GraphQL mode:
1. Open a new request tab.

2. Click the button labeled "HTTP" at the top left of the request heading.
3. Select GraphQL from the dropdown menu.
4. The interface updates, providing sections for Schema, Query, and Variables.

Copy of Copy of Untitled Design (12).png

Understanding the GraphQL Interface

When GraphQL is selected, the request editor includes:

  • Schema Section – Displays available data fields, allows server URL entry for introspection, and includes a refresh option.

  • Query Section – A dedicated editor for writing queries and mutations with syntax highlighting for clarity.

  • Variables Section – Enables dynamic parameters in JSON format, avoiding hardcoded values.

Copy of Copy of Untitled Design (14).png

Sending a GraphQL Request

Once the query is written and variables (if needed) are defined:
1. Click Send to execute the request.
2. DocStar will fetch data from the API and display the response.

Viewing the GraphQL Response

The response section in DocStar provides:

  • The response body with the requested data.

  • Errors, if any, such as invalid queries or missing fields.

  • Headers and status codes to track API performance.

DocStar provides a dedicated interface for GraphQL requests, allowing users to send queries and mutations, explore API schemas, and define variables for dynamic requests.


4. Managing Environments

DocStar allows users to create two types of environments:

  • Global Environments – Accessible across all collections and requests.

  • Private Environments – Available only within a specific workspace

Copy of Copy of Untitled Design (13).png

 How to Add an Environment:

  1. Navigate to the Environments section. Click on the Add Environment

  2. Choose whether the environment is Global or Private.

  3. Enter the required variables and their values.

  4. Save the environment for future use.

To Delete an Environment:

  1. Open the Environments section.

  2. Select the environment you want to remove.

  3. Click the Bin option to permanently remove it.

How to Import an Environment:

  1. Go to the Environments section.

  2. Click on the Import button.

  3. Select the file containing environment configurations.

  4. DocStar will automatically load and apply the imported settings.


5. Write Scripts

DocStar allows you to enhance API testing by writing scripts that execute at different stages of an API request. With Pre-Scripts and Post-Scripts, you can dynamically modify requests, validate responses, and automate workflows. Additionally, the Snippets section provides ready-to-use script templates to simplify script writing.

1. Writing pre-scripts

Pre-scripts run before the API request is sent, allowing you to:
✔ Set authentication tokens dynamically.
✔ Generate timestamps or unique identifiers.
✔ Modify request parameters or headers.
✔ Load environment variables for use in the request.

2. Writing Post-Scripts

Post-scripts run after receiving the API response, helping you:
✔ Validate status codes and response formats.
✔ Extract values from the response body for further use.
✔ Compare response time for performance monitoring.
✔ Log errors or unexpected behaviors for debugging.

Using Snippets for Quick Scripting

DocStar provides a Snippets panel with pre-written script templates to simplify automation. You can:

1.Set or retrieve environment variables (e.g., API keys, tokens).
2. Modify request headers dynamically.
3. Check conditions within the response body.
4. Clear stored variables for fresh requests.