Getting started

The DevRev API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

If you’re new to DevRev APIs, you’ve come to the right place. Our APIs serve as the foundation for integrating your apps, building automations, and creating custom snap-ins. You can also refer to our Postman collection.

Run In Postman

https://api.devrev.ai

You can use the DevRev API in test a demo organization which doesn’t affect your live data or interact with your real customers.

To create a new organization in DevRev:

  1. Click on your profile picture on the top left corner.
  2. Go to the Orgs section and click on +.
  3. Fill in the details and click Create.

Now you can find your newly created org in Orgs.

Login into your demo org and obtain the PAT token. Now you can use this PAT token to make test API calls and try building something new.

In this tutorial, you will be able to retrive your account information by using the dev-users API. Let’s get started with DevRev APIs.

Prerequisites

First, create a DevRev account or log in.

Every call to a DevRev API must include a PAT. After you create your account, generate a personal access token and store it in a safe place.

In this guide, you’ll make a call to the dev-users.self API which gets the authenticated user’s information. You will retrieve the user object created for your account on DevRev. This user object contains information such as a unique identifier, full name, display name, and profile picture.

Every object in DevRev is uniquely identified by an id known as DevRev Object Notation (DON). DON id can be found in the API response. The value SELF can be passed in as id to reference the logged-in user.

The display-id shown in the UI for work item objects such as issues and tickets can be used interchangeably with the id to enhance usability. In the image below, ISS-69 serves as an example of a display-id for issues.

Display ID in DevRev UI

Next, you’ll want to set up your development environment to connect and interact with the DevRev API.

Send your first API request

To do this, make a GET request to the DevRev server (“https://api.devrev.ai/dev-users.self”) and include the PAT created in the authorization header of the request.

This guide shows you how to get user information with a GET request using two popular languages as well as cURL:

Making a GET request

$curl --location --request GET 'https://api.devrev.ai/dev-users.self' \
>--header 'Authorization: <PAT>'

If everything works, the command line displays the following response for a user named “John Smith Doe”:

Response
1{
2 "dev_user": {
3 "display_handle": "John Doe",
4 "created_date": "2022-01-28T10:45:53.698Z",
5 "modified_date": "2022-01-28T10:45:53.698Z",
6 "profile_picture": "<logo-url-here>",
7 "auth0_user_ids": [
8 "auth0|abcd1234eca43c006913f97d"
9 ],
10 "id": "don:identity:dvrv-us-1:devo/20:devu/40",
11 "display_id": "DEVU-40",
12 "state": "active",
13 "full_name": "John Smith Doe",
14 "email": "JohnDoe@devrev.ai"
15 }
16}

The response contains "id": "don:identity:dvrv-us-1:devo/20:devu/40",. The id identifies the devo ID (Dev organization ID) as devo/<devo-id> and the devu ID (Dev user ID) as devu/<devu-id>. In the present response, devo/<devo-id> is 20, and devu/<devu-id> is 40, respectively.

In general, you can find devo, devu, revo, revu IDs in the id or external_ref fields of the API response.

Facing an error while authenticating the APIs? Refer to our errors guide to learn more about our error codes.

Next steps

You’re all set to explore our platform. You are ready to browse through our APIs and build your first integration with DevRev.