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.
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);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)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());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)
}The SDKs are generated by OpenAPI Generator from the
published specification at /openapi/bundled.yaml, so you can
regenerate a client for any supported language yourself:
docker run --rm -v "$PWD:/local" openapitools/openapi-generator-cli:v7.24.0 generate \
-i https://developer.thrivedesk.com/openapi/bundled.yaml \
-g typescript-fetch -o /local/sdk/typescript-fetch \
--additional-properties=npmName=thrivedesk-sdkPin the generator tag rather than using latest, which is a rolling snapshot build.
Two options are load-bearing if you want output matching the clients above: the
--additional-properties package name (omitting it renames the package, and for
TypeScript moves sources out of src/), and, for Go, the --git-user-id /
--git-repo-id flags, without which the generator writes a placeholder module path
that go mod tidy cannot resolve.
Generated code is committed to the repository. SDKs are regenerated whenever the specification changes, and the Changelog records each release.