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
| Interface | Subdomain | ID format |
|---|---|---|
| Legacy console | app1.legalesign.com | REST UUIDs |
| Current console | console.legalesign.com | GraphQL 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:
| Object | Prefix |
|---|---|
| Document | doc |
| Group | grp |
| Recipient | rec |
| Template | tpl |
| Role | rol |
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"