SDK Code Snippets

SDK code snippets help you integrate API requests directly into your application without writing requests from scratch. Each endpoint in the API Reference includes its own SDK example.

Currently, Python SDK snippets are available for all supported endpoints.


Where SDK Snippets Appear on Endpoint Pages

To view SDK code for an endpoint:

  • Open the API Reference
  • Select a section (for example, Organization Management)
  • Click any endpoint (for example, Get Organization)
  • Navigate to the right-side code panel
  • Click Python under the Language selector
  • Select Python SDK

The panel will display the SDK code specific to that endpoint.

Each API reference page provides its own corresponding SDK example.


Difference Between cURL and Python SDK Examples

Two types of request examples are available:

cURL (Shell)

  • Used for quick testing in terminals
  • Sends raw HTTP requests
  • Useful for troubleshooting and experimentation
  • Supports live requests using the Try It button

Python SDK

  • Designed for application integration
  • Uses the official Saner SDK library
  • Provides structured and reusable code
  • Simplifies authentication and request handling

Use Python SDK examples when building integrations inside Python applications.


Copying SDK Code Correctly

To copy the SDK example:

  • Select Python from the Language selector
  • Click Python SDK
  • Locate the code snippet in the request panel
  • Click the Copy button
  • Paste the code into your local Python script or project

Update placeholder values such as:

  • YOUR_API_KEY
  • YOUR_ACCOUNT_ID

before running the script.


Running the SDK Snippet Locally

Before executing the SDK example:

  1. Install the SDK using:

    pip install secpod-saner-sdk
  2. Paste the copied code into a Python file

  3. Replace placeholder credential values with your actual credentials

  4. Run the script using:

    python filename.py

The script will execute the API request and print the response.


Important Note About Live Requests in SDK Mode

When Python SDK mode is selected:

  • The Try It button cannot be used to execute live API requests from the documentation interface

To test requests directly inside the documentation:

  • Switch to another language such as Shell (cURL) or HTTP
  • Then click Try It

Use SDK mode specifically for copying integration-ready code.


Common Mistakes to Avoid

  • Forgetting to replace placeholder credential values
  • Not installing the secpod-saner-sdk package before running the script
  • Attempting to use the Try It button while Python SDK mode is selected
  • Using an incorrect base URL or account ID
  • Running the script without valid authentication credentials

Following these steps ensures successful execution of SDK-based API requests.


Did this page help you?