Skip to main content

REST IDs and GraphQL IDs

Legalesign has two APIs — REST and GraphQL — and each uses a different ID format. The underlying identifier is the same in both cases; only the format differs, so they can be converted between each other. The two web interfaces reflect this directly.

Which interface uses which ID​

InterfaceSubdomainID format
Legacy consoleapp1.legalesign.comREST UUIDs
Current consoleconsole.legalesign.comGraphQL IDs (base64-encoded)

If you are working with the REST API, use the IDs visible in app1. If you are working with the GraphQL API, use the IDs visible in console.

REST IDs​

REST IDs are plain UUIDs, for example:

e6b23ca1-8443-416d-8319-c80a0afa2002

GraphQL IDs​

GraphQL IDs are base64-encoded strings built from a 3-character object prefix and the underlying UUID:

doc + e6b23ca1-8443-416d-8319-c80a0afa2002  →  base64  →  ZG9jZTZiMjNjYTEtODQ0My00MTZkLTgzMTktYzgwYTBhZmEyMDAy

Common prefixes:

ObjectPrefix
Documentdoc
Groupgrp
Recipientrec
Templatetpl
Rolerol

Converting between formats​

REST UUID → GraphQL ID​

Prefix the UUID with the object prefix and base64-encode the result:

Node.js / browser
btoa("doc" + "e6b23ca1-8443-416d-8319-c80a0afa2002")
// "ZG9jZTZiMjNjYTEtODQ0My00MTZkLTgzMTktYzgwYTBhZmEyMDAy"

GraphQL ID → REST UUID​

Decode the base64 string and strip the first 3 characters:

Node.js / browser
atob("ZG9jZTZiMjNjYTEtODQ0My00MTZkLTgzMTktYzgwYTBhZmEyMDAy")
// "doce6b23ca1-8443-416d-8319-c80a0afa2002"
// strip "doc" → "e6b23ca1-8443-416d-8319-c80a0afa2002"

Export This Article

Save a copy of this page as PDF or plain text.