Get started with your first API

This guide will help you make your first API call to Ryder's Developer Portal. The steps are as follows:

  1. Create an app within a specific Ryder product

  2. Request an access token

  3. Use the access token to request data from Ryder's APIs

Prerequisites

  • You have a Ryder Developer Portal account. Follow the relevant Onboarding flow to create an account

  • You have cURL or a similar tool installed to make API calls

Step 1: Create an app

  1. Log in to the Ryder API Developer Portal

  2. Navigate to the "Products" section and locate a product (in this example, we will use the product for Carriers, but you may have access to different products)

  3. Click on the "SCS Carriers" product

  4. Within the "SCS Carriers" product page, locate the application creation form

  5. Enter the following information:

    • App Name: My Carrier App

    • App Description: This is my first Ryder API app as a carrier

    • Redirect URI: http://localhost:3000 (you can use this for testing purposes)

  6. Check the Developer Terms of Service checkbox and click "Create"

    Note: By creating an application within the SCS Carriers product, you are automatically subscribed to the product's APIs.

Step 2: Request an access token

1. Go to your Profile menu and click on "Applications"

2. Click on the name of the app you just created (My Carrier App)

3. Find your Client ID and Client Secret (click "View client secret" to reveal it)

4. Use the Client Credentials grant type to request an access token by sending a POST request to the token endpoint:

curl -X POST "https://api.ryder.com/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=your-client-id&client_secret=your-client-secret"

The response will include an access token valid for 1 hour:

{
"access_token": "your-access-token",
"token_type: "Bearer",
"expired_in": 3600
}

Step 3: Request data from Ryder's APIs

  1. For this example, we'll use the "Record Load Milestone Events" API

  2. Include the access token in the Authorization header of your API call:

curl -X POST "https://api.ryder.com/v1/load-milestone-events" \
-H "Authorization: Bearer your-access-token" \
-H "Content-Type: application/json" \
-d '{"load_id": "12345", "milestone_type": "pickup", "event_time": "2023-04-01T10:00:00Z"}'

If the request is successful, the API will return a confirmation message.

For more information on the "Record Load Milestone Events" API, visit the API product page in the developer portal. The API specification provides detailed documentation on request and response formats, required fields, and error handling.

Additional considerations

  • Explore other APIs available in the SCS Carriers product to find the ones that best suit your needs

  • Set up your application to handle API responses (200, 300, 400 status codes) for easier troubleshooting. For more guidance, review our Troubleshooting and Common error handling guides

Next steps

  • Read the authorization guide to understand different authentication flows

  • Review the API calls guide for detailed information on request and response formats

  • Check out the tutorials and code samples provided in the developer portal to learn best practices and implementation tips