Getting Started

Getting started

With the Avis Budget Group (ABG) platform, you can build, test, and deploy applications on ABG's highly-scalable and reliable infrastructure for your web, mobile, and backend solutions.

This overview is designed to help you understand the overall landscape of how to get connected to ABG APIs.

Create an account

Create an account to get the most out of your experience. We’ll render documentation based on your log-in. We currently offer Rental Cars and Chauffeur APIs with various access tiers. Upon successful registration, you will be able to access these APIs in our sandbox environment (a.k.a. test) instantly. If you prefer to jump right into the APIs and make live calls, check out the API Explorer capabilities on each API reference page.

  1. Click the user profile icon (upper top right).
  2. You should see a pop-up (right) to log-in. (If you already registered, enter your user name and password to log-in.)
  3. Click Sign-up.
  4. Enter basic account details, including your name and email address.
  5. Click Sign-up to create your account.
  6. You should see the Developer Dashboard button and your initials (upper top right).

Create an application

Before you can make your first call, you first need to register a new app with to get a client ID and client secret. When registering a new app, describe basic information about your app, such as the application name, and a redirect URI to be used to redirect your users following authentication.

Steps

  1. Click the user profile icon (upper right corner) to log-in to your account.
  2. Click the Request Access button (upper right corner) from any given API product in the "Docs" section.
  3. Click Create a New Application. (If you already created an app, the Select Existing Application option will be displayed).
  4. You need to fill in some basic information about your app. Give it a name and a brief description of what your app will do.
  5. Enter the redirect URL where you would like to redirect users following successful authorization (if applicable).
  6. Select the API you would like to access in the API Instance field. Once you request access, you can use the same client ID and client secret for each of the APIs that belong to your application.
  7. ABG generates a set of OAuth 2.0 Client ID and Client Secret application credentials for the sandbox environment in this pop-up. You can also access these credentials from the Developer Dashboard.
  8. Your app is now registered and ready to setup!

Review app details on the developer dashboard

The Developer Dashboard contains a wealth of important information about your app, including call history for all of your applications. Throughout the setup, we will be referencing information from the dashboard, so take some time to familiarize yourself with it now.

Once you create your app and get your credentials, you can revisit the developer dashboard at any time by clicking the Developer Dashboard icon (upper right corner) after you have logged-in. To modify, click the app name to view details, including your application's client ID and client secret credentials.

Redirect URLs

Before your application can access private data using ABG APIs, it must obtain an access token that grants access to that API. There are several ways to make an access token request, and they vary based on the type of application you are building. A JavaScript application might request an access token using a browser redirect, while an application installed on a device that has no browser uses web service requests.

A redirect URL is your website page to which you redirect users following successful authorization. Any HTTP redirect URLs must be protected with TLS 1.2 security.

You must specify all redirect URLs for an application before you can use it in an app.

Going live with your app

After you code and debug your application, including testing all of your ABG API calls in the sandbox, contact us before attempting to go live with a production-level application with your users.

Get a token

Your application needs to exchange an authorization code (Client ID and Client Secret) for a user access token. This token gets you connected to ABG APIs. You can retrieve the Client ID and Client Secret for any given application you created from your Developer Dashboard.

You'll always get a token from the same environment you wish to call a given API. The following demonstrates the method and endpoint for the Sandbox environment. NOTE a user access token will be active for 7199 seconds (that's about 119 minutes).

Steps

An example user access token request to the stage (a.k.a. test) environment is shown below:

Python
 
                
 # api-endpoint
    URL = " https://stage.abgapiservices.com/oauth/token/v1 "
    headers = {
        'client_id': '5cb5ea6db77b49dba91671d01b00210a',
        'client_secret': '10F6d8C7BffE46A992b6a9B6bAb69fC6'
    }
    # sending get request and saving the response as response object
    r = requests.get(url=URL, headers=headers)
    # extracting data in json format
    data = r.json()
 
    print("***************************************************")
    print("Authentication API Response")
    print("Response Data:", data)
    print("Response Header Info:", r.headers)
    print("Response Status Code:", r.status_code)
    print("Access Token:", data['access_token'], ", Token Type:", data['token_type'],
          ", Expires In:", data['expires_in'])

Required

Name Type Description
Content-Type string The MIME media type. Example value: application/json
client_id string The client ID for the application you created on the ABG platform. Example value: 7bc7af29341445fe80aa5d16e61876e5
client_secret string The client secret for the application you created on the ABG platform. Example value: 6ab6zg30132036gf90bb6e27f82987f6

Valid

The server replies with an access token and an expiration value.


{
   "access_token":"pehz7c0EpapbCW7wDG2TefeSPXh0",
   "token_type":"Bearer",
   "expires_in":7199
}

Invalid syntax

    
    {
        "status":{
           "request_time":"2018-07-04T13:05:10Z",
           "request_errors": 1,
           "errors":[
              {
                 "code":"400",
                 "message":"Bad Request",
                 "reason": "invalid_request",
                 "details": "Invalid credentials were provided in the request."
             }
           ]
       }
     }

Unauthorized

    
    {
        "status":{
           "request_time":"2018-10-06T15:30:38Z",
           "request_errors": 1,
           "errors":[
              {
                 "code":"401",
                 "message":"Unauthorized",
                 "reason":"authentication_failure",
                 "details":"Missing or expired credentials were provided in the request."
              }
           ]
        }
     }

Send your first request

Now that you have an access token, you can make requests to an API. The following request demonstrates a request to the Location Keyword Search endpoint in Python. To view code snippets in other programming languages, go to the API documentation.

Python
 
            
                token = "X3nscWiLJcT74dnjTMxmGJLzXdsl"
                #set header information
                headers = {
                    'Authorization': "Bearer " + token,
                    'Accept': '*/*',
                    'content-type': "application/json"
                }
                # api-endpoint
                URL = "https://stage.abgapiservices.com/cars/location/v1"
            
                # defining a params dict for the parameters to be sent to the API
                PARAMS = {'keyword': 'london', 'brand': 'AVIS', 'client_country_code': 'US'}
            
                # sending get request and saving the response as response object
                r = requests.get(url=URL, params=PARAMS, headers=headers)
            
                # extracting data in json format
                data = r.json()
            
                print("***************************************************")
                print("Location API Response")
                print("Response Data:", data)
                print("Response Header Info:", r.headers)
                print("Response Status Code:", r.status_code)
                print("Location Information :", data['locations'][0]['location'])
            
            
 

Environments

All host names on the ABG developer portal are for the stage environment at: https://stage.abgapiservices.com/. Please contact us before attempting to go live with a production-level application with your users.

Versioning

The first “Live” release of an ABG API will always be v1. Following the first “Live” major release, APIs use the version scheme vMajor.Minor.Patch, incrementing the:

  • Major version when we make backward-incompatible API changes;
  • Minor version when we add functionality in a backward-compatible manner;
  • Patch version when we make backward-compatible bug fixes.

vMajor.Minor.Patch

  • We always introduce the first major "Live" version of an API as v1.
  • We always introduce a minor release of any major version as v1.1. For example, if the version of an endpoint is v1.2, that means two minor releases have occurred for that endpoint.
  • We do our best not to introduce any bugs in our code. When we need to patch things up, the first patch release of any major release is always v1.0.1. In this example, a major release has occurred, with no minor release, and a patch release has occurred.

Learn more about our version scheme, backward-compatibility and other design guidelines in our API Design Guide.