REST API Basics
REST stands for “Representational State Transfer”. Basically with a REST API call you are to get a piece of data (called a resource) when you link to a specific URL.
Each URL is called a request while the data sent back to you is called a response.
The Components of a REST API Request
A REST API request consist of 4 components: the url (the endpoint), the HTTP Verbs (the method), the headers and the data (or body).
The url consists of a root-endpoint and a path.
These are the root endpoints of the 4me service:
- Production environment global:
- Production environment Australia:
- QA environment global:
- QA environment Australia:
- Demo environment:
The path determines the resource you’re requesting for. For example, you will use the url
https://api.4me.com/v1/changes to access the record type ‘changes’ in a 4me production environment outside Australia.
With the HTTP Verb you specify the type of request you send to the server. You can choose from the types below:
These methods provide meaning for the request you’re making. They are used to perform four possible actions: Create, Read, Update and Delete (CRUD).
The HTTP Headers
Each request to the 4me REST API must supply two headers to specify your personal access token and to specify the 4me account you need access to:
Authorization: Bearer <personal-access-token>
Access Rights – the Personal Access Token
With a personal access token you tell the 4me service who you are and based on your roles in 4me and on the access rights that have been specified in your personal access token, you will be able (or not …) to perform the actions on the resources as pecified in your REST API request. Read this topic on personal access tokens in the 4me GraphQL training to create and update a personal access token.