Skip to main content

Introduction

API developers making esigning solution for their organisations have a choice of APIs to access Legalesign services: REST, which is a traditional and well known format, or GraphQL, which is a newer, more flexible format. Often your choice of these two will depend on your development environment but, generally speaking, either API can be used with any coding language. In this guide we assume that you are familiar with JSON, a coding language and basic internet requests.

Getting Started with GraphQL

Legalesign provides a Legalesign GraphiQL Explorer (you'll need to have an active account to use it) which enables you to craft and execute graphQL queries from the comfort of your browser before you try to intergrate them into your API code.

Sample GrapiQL page

info

We highly recommend that you try out some queries in the GraphQL explorer to get started. This will confirm that your account and credentials are in good order, and get you used to graphql syntax before you have to bother with particular coding languages and projects. You can always use this tool to check and test your queries behaviour before you put it into your code.

Try this simple query;

query myInfo {
user {
id
firstName
lastName
email
}
}

Your result should look like the following JSON:

{
"data": {
"user": {
"id": "dXNyNjBkNWNkODktMDg3NS00ZXC67mItZjI3ODA5NjgwMDdl",
"firstName": "Tester",
"lastName": "Api",
"email": "api.tester@legalesign.com"
}
}
}

As you can see this allows an authenticated user to get their own id, firstname, lastname and email address. GraphQL allows for far more complex and tree-like queries - as well as mutations which let you alter data and send actions to the platform.

info

Remember everything you see in the Legalesign Console is created and actioned through the GraphQL API, so if you see it there you can make it happen in your own systems, and more!