Skip to main content
Every group of endpoints in the API reference is a class in the libraries, and every endpoint is a method of its class. A class is named after its group, with Api at the end (API in Go): WidgetsApi holds the calls under Widgets.

The classes

Which key a class needs

The last column says which key each class is meant for. It comes from the x-access-level of the endpoints, and the key is sent the same way for all of them: as the bearer token, whichever language you use (see Get started).
  • An organisation key (wdg_org_) is made in the dashboard and acts as one workspace. Most endpoints take it.
  • A partner key (wgt_prt_) is made in your partner’s home workspace and is for a platform that runs Widgetic for its own customers. The partner classes need one.
  • No key: PublicEmbedApi is what a published widget calls from a visitor’s browser. You seldom call it from a server: the embed script does it for you.
API keys compares the two kinds of key and says which calls of each class they can make. Authentication lists the prefixes.

How a call is named

A method is named after the operation id of its endpoint, written the way the language writes a name: createWidget, create_widget, CreateWidget. What differs is how each language takes the arguments. This is the call that creates a widget, in each of them: A path or query parameter is an argument, and so is a header that the endpoint takes: Idempotency-Key becomes idempotencyKey, and a partner’s X-Managed-User-Id becomes xManagedUserId, in the case of each language. The body is an argument too, under the name of its model. To find the call for an endpoint, open it in the API reference and pick your language in the code sample. The samples are built from the libraries’ own signatures, so a name you copy from one exists.

Public embed routes

The routes behind the embed script are at https://api.widgetic.com/embed, and the libraries default to an address that ends in /v1. Build PublicEmbedApi with the API address without it. The samples of those endpoints in the API reference do this for each language. In TypeScript:

Next steps

Requests and errors

Page through a list, create something once, and handle an error

Managed users

The calls a partner makes for its customers, with a partner API key