Step 1: Authenticate and Send Your First Request

All operations with our API must be executed over HTTPS. Our sandbox endpoint is https://api-sandbox.rev.com.

Every API request must be authenticated via the Authorization header, where you paste in your client and user keys. If you don’t have these keys for the sandbox, you can get them here.

Rev [Client API Key]:[User API Key]

Now let’s make our first request using the Sandbox API. All examples in the Quick Start use cURL, a simple command line tool for transferring data. You can access cURL in the following ways:

  • On PC, Mac, or Linux: Using Postman to interpret cURL commands- our recommended tool
  • On a PC: by downloading cURL
  • On a Mac or Linux: via Terminal, where cURL should be installed by default

Run the following GET /orders request; it returns all the orders you’ve placed.

curl -X GET \
    https://api-sandbox.rev.com/api/v1/orders \
    -H 'Authorization: Rev [ClientApiKey]:[UserAPIKey]'
var https = require('https');

var options = {
  host: 'api-sandbox.rev.com',
  path: '/api/v1/orders',
  method: 'GET',
  headers: {
    'Authorization': 'Rev [ClientApiKey]:[UserAPIKey]'
  }
};

var req = https.request(options, (resp) => {
  var data = [];

  resp.on('data', (chunk) => {
    data.push(chunk);
  });

  res.on('end', function() {
    console.log('Status Code:', resp.statusCode);
    console.log(JSON.parse(data));
  });
});
req.end();

You should receive the result below, which tells us no sandbox orders have been placed. We’ll be changing that in the next step.

{
   "total_count": 0,
   "results_per_page": 25,
   "page": 0,
   "orders": []
}

Voilá! You have now completed your first API request with the Rev API.

Having trouble? Email apisupport@rev.com and one of our engineers will reply.