SDKs

Use and regenerate the TypeScript, Python, PHP, and Go clients generated from the OpenAPI specification.

Four first-party SDKs are generated from this OpenAPI specification and committed under sdk/ at the root of this repository. Each is a thin HTTP wrapper; applications bring their own retry, caching, and concurrency primitives.

TypeScript and JavaScript

Fetch-based with no runtime dependencies. It works in Node.js 18+ and modern browsers.

import { Configuration, ConversationsApi } from "./sdk/typescript-fetch";

const config = new Configuration({
  basePath: "https://api.thrivedesk.com/v1",
  accessToken: process.env.THRIVEDESK_TOKEN,
});

const conversations = new ConversationsApi(config);
const mine = await conversations.conversationsMineGet({ perPage: 20 });
console.log(mine.data);

Python

Uses urllib3 and requires Python 3.9+.

import os
import thrivedesk
from thrivedesk.rest import ApiException

configuration = thrivedesk.Configuration(
    host="https://api.thrivedesk.com/v1",
    access_token=os.environ["THRIVEDESK_TOKEN"],
)

with thrivedesk.ApiClient(configuration) as api_client:
    api = thrivedesk.ConversationsApi(api_client)
    mine = api.conversations_mine_get(per_page=20)
    print(mine.data)

PHP

Uses Guzzle 7, requires PHP 8.1+, and ships with a replaceable PSR-18 client.

<?php
require_once __DIR__ . '/sdk/php/vendor/autoload.php';

$config = OpenAPI\Client\Configuration::getDefaultConfiguration()
    ->setHost('https://api.thrivedesk.com/v1')
    ->setAccessToken(getenv('THRIVEDESK_TOKEN'));

$api = new OpenAPI\Client\Api\ConversationsApi(
    new GuzzleHttp\Client(),
    $config
);
$mine = $api->conversationsMineGet(20);
print_r($mine->getData());

Go

Uses net/http directly and requires Go 1.20+.

package main

import (
    "context"
    "fmt"
    "os"

    openapiclient "github.com/thrivedesk/sdk-go"
)

func main() {
    cfg := openapiclient.NewConfiguration()
    cfg.Host = "api.thrivedesk.com/v1"
    cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("THRIVEDESK_TOKEN"))

    client := openapiclient.NewAPIClient(cfg)
    mine, _, err := client.ConversationsAPI.ConversationsMineGet(
        context.Background(),
    ).PerPage(20).Execute()
    if err != nil {
        panic(err)
    }
    fmt.Println(mine.Data)
}

Regenerating the SDKs

The SDKs are generated by OpenAPI Generator from openapi/bundled.yaml. Use the exact commands in the repository README, including the load-bearing package-name and module-path options.

Generated code is committed to the repository. SDKs are regenerated whenever the specification changes, and the Changelog records each release.