### Get Vehicle Capabilities (cURL) Source: https://developer.volvocars.com/apis/energy/v2/endpoints/capabilities This example demonstrates how to make a GET request to the /vehicles/{vin}/capabilities endpoint using cURL. It includes mandatory headers such as 'accept', 'authorization', and 'vcc-api-key'. The response body is a map of capabilities, indicating support for various energy-related features. ```shell curl -X GET 'https://api.volvocars.com/energy/v2/vehicles/{vin}/capabilities' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` -------------------------------- ### Authorization Header Example Source: https://developer.volvocars.com/apis/location/v1/details This example demonstrates how to include the OAuth2 access token in the 'authorization' header for API requests. An access token is required for authenticated access. ```bash -H 'authorization: Bearer ' ``` -------------------------------- ### Get Vehicle Energy State (JSON Example) Source: https://developer.volvocars.com/apis/energy/v2/endpoints/energy-state This example demonstrates the expected JSON response when successfully retrieving the vehicle's energy state. It includes the status, value, unit, and update timestamp for a resource. ```json { "status": "OK", "value": 50.5, "unit": "percentage", "updatedAt": "2025-05-27T11:28:24Z" } ``` ```json { "status": "OK", "value": 180, "unit": "km", "updatedAt": "2025-05-27T11:28:24Z" } ``` ```json { "status": "OK", "value": "DISCONNECTED", "updatedAt": "2025-05-27T11:28:24Z" } ``` -------------------------------- ### API Key Header Example Source: https://developer.volvocars.com/apis/location/v1/details This example shows how to include your VCC API key in the header of requests to the Location API. The API key is obtained after creating an application. ```bash -H 'vcc-api-key: ' ``` -------------------------------- ### GetEnergyStateCapability Example Source: https://developer.volvocars.com/apis/energy/v2/endpoints/capabilities This JSON example illustrates the structure of the GetEnergyStateCapability, which extends the base Capability object. It details the support status for various energy state-related features such as battery charge level, electric range, and charging status. The 'isSupported' flag is present for each sub-capability. ```json { "isSupported": true, "batteryChargeLevel": { "isSupported": true }, "electricRange": { "isSupported": true }, "chargerConnectionStatus": { "isSupported": true }, "chargingStatus": { "isSupported": true }, "chargingType": { "isSupported": true }, "chargerPowerStatus": { "isSupported": true }, "estimatedChargingTimeToTargetBatteryChargeLevel": { "isSupported": true }, "targetBatteryChargeLevel": { "isSupported": true }, "chargingCurrentLimit": { "isSupported": true }, "chargingPower": { "isSupported": true } } ``` -------------------------------- ### Start Engine (API) Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/engine Initiates the vehicle's engine start command. Requires 'openid' and 'conve:engine_start_stop' scopes. The request body must include 'runtimeMinutes' (1-15 minutes). The response provides VIN, status code, and invoke status. ```curl curl -X POST 'https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/commands/engine-start' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' \ -d '{"runtimeMinutes":10}' ``` ```json { "runtimeMinutes": 10 } ``` -------------------------------- ### GET /capabilities Source: https://developer.volvocars.com/apis/energy/v2/overview Retrieves the technical capabilities and supported features of the connected vehicle. ```APIDOC ## GET /capabilities ### Description Retrieves information about the specific capabilities supported by the vehicle. ### Method GET ### Endpoint /capabilities ### Parameters #### Path Parameters - **vin** (string) - Required - The Vehicle Identification Number ### Request Example GET /capabilities?vin=123456789 ### Response #### Success Response (200) - **capabilities** (array) - List of supported vehicle features #### Response Example { "capabilities": ["remote_charge_start", "climate_control", "battery_status"] } ``` -------------------------------- ### Error Response Example (JSON) Source: https://developer.volvocars.com/apis/energy/v2/endpoints/energy-state This example shows the structure of an error response from the Energy API v2. It includes the status, an error code, and a descriptive message when data retrieval fails. ```json { "status": "ERROR", "code": "PROPERTY_NOT_FOUND", "message": "No valid value could be found for the requested property" } ``` -------------------------------- ### Climate - Start Climatisation Response (Now) Source: https://developer.volvocars.com/apis/connected-vehicle/v2/release-notes This JSON snippet shows the expected response structure when starting climate control in version 2 of the API. It confirms the completion of the operation. ```json { "data": { "vin": "", "invokeStatus": "COMPLETED", "message": "" } } ``` -------------------------------- ### GET /vehicles/{vin}/warnings Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/warnings Retrieves a list of warning statuses for a specific vehicle identified by its VIN. ```APIDOC ## GET /vehicles/{vin}/warnings ### Description Retrieves a list of warning statuses for various components of a specific vehicle. ### Method GET ### Endpoint /vehicles/{vin}/warnings ### Parameters #### Path Parameters - **vin** (string) - Required - The Vehicle Identification Number (VIN) of the vehicle. #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET 'https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/warnings' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` ### Response #### Success Response (200) - **turnIndicationRearLeftWarning** (object) - Warning status for the rear left turn indicator. - **timestamp** (string) - Timestamp in ISO-8601 format when the value was last retrieved. - **value** (string) - Possible values: UNSPECIFIED, NO_WARNING, FAILURE. - **turnIndicationRearRightWarning** (object) - Warning status for the rear right turn indicator. - **timestamp** (string) - Timestamp in ISO-8601 format when the value was last retrieved. - **value** (string) - Possible values: UNSPECIFIED, NO_WARNING, FAILURE. - **registrationPlateLightWarning** (object) - Warning status for the registration plate light. - **timestamp** (string) - Timestamp in ISO-8601 format when the value was last retrieved. - **value** (string) - Possible values: UNSPECIFIED, NO_WARNING, FAILURE. - **sideMarkLightsWarning** (object) - Warning status for the side mark lights. - **timestamp** (string) - Timestamp in ISO-8601 format when the value was last retrieved. - **value** (string) - Possible values: UNSPECIFIED, NO_WARNING, FAILURE. Not available for Classic cars. - **hazardLightsWarning** (object) - Warning status for the hazard lights. - **timestamp** (string) - Timestamp in ISO-8601 format when the value was last retrieved. - **value** (string) - Possible values: UNSPECIFIED, NO_WARNING, FAILURE. Classic cars specific status. - **reverseLightsWarning** (object) - Warning status for the reverse lights. - **timestamp** (string) - Timestamp in ISO-8601 format when the value was last retrieved. - **value** (string) - Possible values: UNSPECIFIED, NO_WARNING, FAILURE. Classic cars specific status. #### Response Example ```json { "turnIndicationRearLeftWarning": { "timestamp": "2023-10-27T10:00:00Z", "value": "NO_WARNING" }, "turnIndicationRearRightWarning": { "timestamp": "2023-10-27T10:00:00Z", "value": "NO_WARNING" }, "registrationPlateLightWarning": { "timestamp": "2023-10-27T10:00:00Z", "value": "NO_WARNING" }, "sideMarkLightsWarning": { "timestamp": "2023-10-27T10:00:00Z", "value": "NO_WARNING" }, "hazardLightsWarning": { "timestamp": "2023-10-27T10:00:00Z", "value": "NO_WARNING" }, "reverseLightsWarning": { "timestamp": "2023-10-27T10:00:00Z", "value": "NO_WARNING" } } ``` ``` -------------------------------- ### GET /vehicles/{vin}/lighting-status Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/warnings Retrieves the current status and warning indicators for various lighting components of a classic Volvo vehicle. ```APIDOC ## GET /vehicles/{vin}/lighting-status ### Description Retrieves the diagnostic status of vehicle lights, including brake lights, fog lights, beams, and turn signals. This endpoint is specifically for classic cars without Android-based infotainment systems. ### Method GET ### Endpoint /vehicles/{vin}/lighting-status ### Parameters #### Path Parameters - **vin** (string) - Required - The unique Vehicle Identification Number. ### Response #### Success Response (200) - **brakeLightLeftWarning.value** (string) - Status of the left brake light (UNSPECIFIED, NO_WARNING, FAILURE). - **brakeLightLeftWarning.timestamp** (string) - ISO-8601 timestamp of the last data retrieval. - **fogLightFrontWarning.value** (string) - Status of front fog lights (UNSPECIFIED, NO_WARNING, FAILURE). - **highBeamLeftWarning.value** (string) - Status of the left high beam (UNSPECIFIED, NO_WARNING, FAILURE). - **turnIndicationFrontLeftWarning.value** (string) - Status of the front left turn signal (UNSPECIFIED, NO_WARNING, FAILURE). #### Response Example { "brakeLightLeftWarning": { "value": "NO_WARNING", "timestamp": "2023-10-27T10:00:00Z" }, "fogLightFrontWarning": { "value": "NO_WARNING", "timestamp": "2023-10-27T10:00:00Z" } } ``` -------------------------------- ### Get Fuel Amount and Battery Charge Level (cURL) Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/fuel This example demonstrates how to make a GET request to the Connected Vehicle API to retrieve the latest fuel amount and battery charge level for a vehicle. It requires an access token and a VCC API key for authorization. The response includes the fuel amount in liters and/or battery charge level in percent, along with timestamps. ```curl curl -X GET 'https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/fuel' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` -------------------------------- ### GET /vehicles/{vin}/warnings Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/warnings Retrieves vehicle data grouped under warning categories for a specific vehicle identified by its VIN. ```APIDOC ## GET /connected-vehicle/v2/vehicles/{vin}/warnings ### Description Used to get the vehicle data grouped under warning category such as bulb failure. ### Method GET ### Endpoint https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/warnings ### Parameters #### Path Parameters - **vin** (string) - Required - The Vehicle Identification Number. #### Headers - **accept** (string) - Required - The mediatype of what should be returned. Valid value: application/json - **authorization** (string) - Required - The access token issued by Volvo ID identity system. - **vcc-api-key** (string) - Required - Your application’s VCC API Key. ### Scopes - openid - conve:warnings ### Response #### Success Response (200) - **warnings** (array) - List of warning objects associated with the vehicle. #### Response Example { "warnings": [ { "category": "bulb_failure", "status": "active" } ] } ``` -------------------------------- ### POST /vehicles/{vin}/commands/engine-start Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/engine Sends a command to start the vehicle engine for a specified duration. ```APIDOC ## POST /vehicles/{vin}/commands/engine-start ### Description Starts the engine of the vehicle. The runtime can be set up to a maximum of 15 minutes. ### Method POST ### Endpoint https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/commands/engine-start ### Parameters #### Path Parameters - **vin** (string) - Required - The Vehicle Identification Number. #### Request Body - **runtimeMinutes** (integer) - Required - Duration in minutes (max 15). ### Request Example { "runtimeMinutes": 10 } ### Response #### Success Response (200) - **vin** (string) - Vehicle identification number. - **statusCode** (integer) - Response status code. - **invokeStatus** (string) - Status of the command (e.g., RUNNING, COMPLETED, REJECTED). ``` -------------------------------- ### GET /as/authorization.oauth2 Source: https://developer.volvocars.com/apis/docs/authorisation Redirects the end-user to the Volvo ID login page to authenticate and grant consent to requested application scopes. ```APIDOC ## GET /as/authorization.oauth2 ### Description Redirects the end-user to the Volvo ID login page. Upon successful authentication and consent, the user is redirected back to the registered callback URI with an authorisation code. ### Method GET ### Endpoint https://volvoid.eu.volvocars.com/as/authorization.oauth2 ### Parameters #### Query Parameters - **response_type** (string) - Required - Must be set to "code". - **client_id** (string) - Required - The ID of your client credentials. - **redirect_uri** (string) - Required - URL encoded callback URI registered with your application. - **scope** (string) - Required - Space-separated list of scopes, URL encoded. - **state** (string) - Optional - Opaque value to maintain state and prevent CSRF. ### Request Example https://volvoid.eu.volvocars.com/as/authorization.oauth2?response_type=code&client_id=&redirect_uri=&scope=&state= ### Response #### Success Response (302 Redirect) - **code** (string) - The authorisation code to be exchanged for an access token. - **state** (string) - The state value returned from the request. ``` -------------------------------- ### Get Engine Status Source: https://developer.volvocars.com/apis/docs/getting-started Retrieves the current engine status (on/off) of a specific vehicle. This endpoint requires the vehicle's VIN. ```APIDOC ## GET /connected-vehicle/v2/vehicles/{vin}/engine-status ### Description Retrieves the current engine status (on/off) of a specific vehicle. This endpoint requires the vehicle's VIN. ### Method GET ### Endpoint `https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/engine-status` ### Parameters #### Path Parameters - **vin** (string) - Required - The Vehicle Identification Number of the vehicle. #### Query Parameters None #### Headers - **accept** (string) - Required - `application/json` - **authorization** (string) - Required - `Bearer ` - **vcc-api-key** (string) - Required - `` ### Request Example ```bash curl -X GET 'https://api.volvocars.com/connected-vehicle/v2/vehicles/YOUR_VEHICLE_VIN/engine-status' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` ### Response #### Success Response (200) - **engineStatus** (string) - The current status of the vehicle's engine ('on' or 'off'). - **timestamp** (string) - The timestamp indicating when the value was last collected from the vehicle. #### Response Example ```json { "engineStatus": "off", "timestamp": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Fetch Vehicle Statistics using cURL Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/statistics This example demonstrates how to retrieve statistics for a specific vehicle using a cURL command. It requires the vehicle's VIN, an access token, and a VCC API key. The output is expected in JSON format. ```shell curl -X GET 'https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/statistics' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` -------------------------------- ### Get Vehicle List Source: https://developer.volvocars.com/apis/docs/getting-started Retrieves a list of vehicles associated with a Volvo ID account. This endpoint is useful for obtaining Vehicle Identification Numbers (VINs) needed for subsequent requests. ```APIDOC ## GET /connected-vehicle/v2/vehicles ### Description Retrieves a list of vehicles associated with a Volvo ID account. This endpoint is useful for obtaining Vehicle Identification Numbers (VINs) needed for subsequent requests. ### Method GET ### Endpoint `https://api.volvocars.com/connected-vehicle/v2/vehicles` ### Parameters #### Query Parameters None #### Headers - **accept** (string) - Required - `application/json` - **authorization** (string) - Required - `Bearer ` - **vcc-api-key** (string) - Required - `` ### Request Example ```bash curl -X GET 'https://api.volvocars.com/connected-vehicle/v2/vehicles' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` ### Response #### Success Response (200) - **vehicles** (array) - A list of vehicles associated with the account. - **vin** (string) - The Vehicle Identification Number. - **model** (string) - The model of the vehicle. - **year** (integer) - The manufacturing year of the vehicle. #### Response Example ```json { "vehicles": [ { "vin": "YOUR_VEHICLE_VIN", "model": "XC60", "year": 2023 } ] } ``` ``` -------------------------------- ### Proof Key for Code Exchange (PKCE) Source: https://developer.volvocars.com/apis/docs/authorisation Explains the implementation of PKCE for enhanced security in OAuth client applications, preventing authorization code interception attacks. ```APIDOC ## Proof Key for Code Exchange (PKCE) ### Description As part of moving to an automated publishing flow, all new applications will enforce Proof Key for Code Exchange (PKCE) for security reasons. Public OAuth clients are susceptible to authorization code interception attacks, and PKCE is a solution for preventing these attacks by extending the authorization code flow. ### Parameters #### Authorization Endpoint (Query Parameters) - **code_challenge** (string) - Required - Challenge derived from the code_verifier and code_challenge_method. - **code_challenge_method** (string) - Required - Method to derive the code_challenge. #### Token Endpoint (Request Body) - **code_verifier** (string) - Required - Cryptographically random string used to derive the code_challenge. ### Further Reading Read more about PKCE and its benefits by visiting https://oauth.net/2/pkce. _Note: No change will be made to already published applications, although using PKCE is strongly recommended._ ``` -------------------------------- ### API Request Header for Debugging Source: https://developer.volvocars.com/apis/connected-vehicle/v2/details This example shows how to include the 'traceparent' header in an API request for debugging purposes. This header helps Volvo Cars locate your requests in their systems, aiding in troubleshooting. ```bash -H 'traceparent: 00---' ``` -------------------------------- ### Retrieve Tyre Status via Connected Vehicle API Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/tyres A cURL request example demonstrating how to fetch the latest tyre pressure status for a vehicle using the Connected Vehicle API. It requires a valid access token and a VCC API key in the request headers. ```bash curl -X GET 'https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/tyres' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` -------------------------------- ### GET /vehicles/{vin}/tyres Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/tyres Retrieves the latest tyre pressure status values for a specific vehicle identified by its VIN. ```APIDOC ## GET /vehicles/{vin}/tyres ### Description Endpoint used to get the vehicle’s latest tyre status values, including pressure levels for all four tyres. ### Method GET ### Endpoint https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/tyres ### Parameters #### Path Parameters - **vin** (string) - Required - The unique Vehicle Identification Number. #### Headers - **accept** (string) - Required - Must be 'application/json'. - **authorization** (string) - Required - The access token issued by Volvo ID identity system. - **vcc-api-key** (string) - Required - Your application’s VCC API Key. ### Request Example ```bash curl -X GET 'https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/tyres' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` ### Response #### Success Response (200) - **frontLeft.timestamp** (string) - ISO-8601 timestamp of the last status retrieval. - **frontLeft.value** (string) - Pressure level (UNSPECIFIED, NO_WARNING, VERY_LOW_PRESSURE, LOW_PRESSURE, HIGH_PRESSURE). - **frontRight.timestamp** (string) - ISO-8601 timestamp of the last status retrieval. - **frontRight.value** (string) - Pressure level. - **rearLeft.timestamp** (string) - ISO-8601 timestamp of the last status retrieval. - **rearLeft.value** (string) - Pressure level. - **rearRight.timestamp** (string) - ISO-8601 timestamp of the last status retrieval. - **rearRight.value** (string) - Pressure level. #### Response Example { "frontLeft": { "timestamp": "2023-10-27T10:00:00Z", "value": "NO_WARNING" }, "frontRight": { "timestamp": "2023-10-27T10:00:00Z", "value": "NO_WARNING" }, "rearLeft": { "timestamp": "2023-10-27T10:00:00Z", "value": "NO_WARNING" }, "rearRight": { "timestamp": "2023-10-27T10:00:00Z", "value": "NO_WARNING" } } ``` -------------------------------- ### Get Vehicle Location using cURL Source: https://developer.volvocars.com/apis/location/v1/endpoints/location This snippet demonstrates how to retrieve a vehicle's latest known location using a cURL command. It includes the necessary GET request, endpoint URL with a placeholder for the vehicle's VIN, and the mandatory headers for authentication and content type. ```curl curl -X GET 'https://api.volvocars.com/location/v1/vehicles/{vin}/location' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` -------------------------------- ### GET /location/v1/vehicles/{vin}/location Source: https://developer.volvocars.com/apis/location/v1/endpoints/location Retrieves the latest known location, altitude, and heading for a specific vehicle identified by its VIN. ```APIDOC ## GET /location/v1/vehicles/{vin}/location ### Description Endpoint used for getting a vehicle’s latest known location, altitude, and heading. Requires valid authorization and API key headers. ### Method GET ### Endpoint https://api.volvocars.com/location/v1/vehicles/{vin}/location ### Parameters #### Path Parameters - **vin** (string) - Required - The unique Vehicle Identification Number. #### Headers - **accept** (string) - Required - Must be 'application/json'. - **authorization** (string) - Required - The access token issued by Volvo ID identity system. - **vcc-api-key** (string) - Required - Your application’s VCC API Key. ### Request Example ```bash curl -X GET 'https://api.volvocars.com/location/v1/vehicles/{vin}/location' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` ### Response #### Success Response (200) - **data.type** (string) - Always "Feature" - **data.geometry.coordinates** (array) - [Longitude, Latitude, Altitude] - **data.properties.heading** (string) - Compass heading - **data.properties.timestamp** (string) - UTC timestamp of last retrieval #### Response Example { "status": 200, "data": { "type": "Feature", "properties": { "heading": "129", "timestamp": "2023-06-19T09:29:49Z" }, "geometry": { "type": "Point", "coordinates": [11.968305241889837, 57.68877828654959, 0.0] } } } ``` -------------------------------- ### List Commands Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/commands Retrieves a list of commands that can be sent to the vehicle. Each command can then be used with its respective endpoint. ```APIDOC ## GET /vehicles/{vin}/commands ### Description Used to list the commands which can be sent to the vehicle. Each command can then be used in the respective endpoint. ### Method GET ### Endpoint /vehicles/{vin}/commands ### Parameters #### Path Parameters - **vin** (string) - Required - The Vehicle Identification Number. #### Query Parameters None #### Request Body None ### Request Example ```curl GET https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/commands Headers: accept: application/json authorization: Bearer vcc-api-key: ``` ### Response #### Success Response (200) - **command** (string) - Name of the commands available for a vehicle. - **href** (string) - URL of the specific command for a vehicle. #### Response Example ```json { "data": { "commands": [ { "command": "exampleCommandName", "href": "https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/commands/exampleCommandName" } ] } } ``` ``` -------------------------------- ### Capabilities Response Body Example Source: https://developer.volvocars.com/apis/energy/v2/endpoints/capabilities This JSON structure represents a typical response from the /vehicles/{vin}/capabilities endpoint. It shows a map of capabilities, where each key (e.g., 'getEnergyState') represents a specific feature. The 'isSupported' boolean flag indicates whether the capability is available for the vehicle. Nested capabilities, like 'chargingPower', can also be present with their own support status. ```json { "getEnergyState": { "isSupported": true, ... "chargingPower": { "isSupported": false } } } ``` -------------------------------- ### Get Odometer Value using cURL Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/odometer This snippet demonstrates how to make a GET request to the odometer endpoint using cURL. It includes the necessary endpoint URL, accept header, authorization token, and VCC API key. ```curl curl -X GET 'https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/odometer' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` -------------------------------- ### Redirect end-user to Volvo ID login page Source: https://developer.volvocars.com/apis/docs/authorisation Constructs the authorization URL to initiate the OAuth 2.0 flow. The user is redirected to the Volvo ID login page to authenticate and grant consent for requested scopes. ```URL https://volvoid.eu.volvocars.com/as/authorization.oauth2?response_type=code&client_id=&redirect_uri=&scope=&state= ``` -------------------------------- ### POST /as/token.oauth2 Source: https://developer.volvocars.com/apis/docs/authorisation Exchanges an authorisation code for an access token to be used as a bearer token for API requests. ```APIDOC ## POST /as/token.oauth2 ### Description Exchanges the authorisation code received from the login redirect for an access token and a refresh token. ### Method POST ### Endpoint https://volvoid.eu.volvocars.com/as/token.oauth2 ### Parameters #### Headers - **content-type** (string) - Required - "application/x-www-form-urlencoded" - **authorization** (string) - Required - "Basic " #### Request Body - **grant_type** (string) - Required - Must be "authorization_code". - **code** (string) - Required - The authorisation code from the previous step. - **redirect_uri** (string) - Required - The same callback URI used in the initial request. ### Request Example curl -X POST 'https://volvoid.eu.volvocars.com/as/token.oauth2' \ -H 'content-type: application/x-www-form-urlencoded' \ -H 'authorization: Basic ' \ -d 'grant_type=authorization_code&code=&redirect_uri=' ### Response #### Success Response (200) - **access_token** (string) - Token used as a bearer token for API calls. - **refresh_token** (string) - Token used to obtain new access tokens. - **token_type** (string) - Always "Bearer". - **expires_in** (integer) - Expiration time in seconds. ``` -------------------------------- ### GET /energy-state Source: https://developer.volvocars.com/apis/energy/v2/overview Retrieves the current energy state of the vehicle, including battery levels, charging status, and estimated range. ```APIDOC ## GET /energy-state ### Description Retrieves information about the latest energy state of the vehicle, including battery charge, charging connection status, and electric range. ### Method GET ### Endpoint /energy-state ### Parameters #### Path Parameters - **vin** (string) - Required - The Vehicle Identification Number ### Request Example GET /energy-state?vin=123456789 ### Response #### Success Response (200) - **batteryChargeLevel** (integer) - Current battery percentage - **chargingStatus** (string) - Current status of the charging system - **electricRange** (integer) - Estimated remaining range in km #### Response Example { "batteryChargeLevel": 85, "chargingStatus": "CHARGING", "electricRange": 350 } ``` -------------------------------- ### POST /vehicles/{vin}/commands/flash Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/lights-sound Sends a command to flash the vehicle's exterior lights. The turn signals will flash. Use List commands to check vehicle support. ```APIDOC ## POST /vehicles/{vin}/commands/flash ### Description Sends a command to flash the vehicle's exterior lights. The turn signals will flash. Use List commands to check vehicle support. ### Method POST ### Endpoint /vehicles/{vin}/commands/flash ### Parameters #### Path Parameters - **vin** (string) - Required - The vehicle identification number. #### Query Parameters None #### Request Body None ### Request Example ```curl curl -X POST 'https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/commands/flash' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` ### Response #### Success Response (200) - **vin** (string) - Vehicle identification number. - **statusCode** (integer) - Response status code. - **invokeStatus** (string) - Invoke status of the request sent to the vehicle. Possible values: COMPLETED, REJECTED, UNKNOWN, TIMEOUT, CONNECTION_FAILURE, VEHICLE_IN_SLEEP, DELIVERED, CAR_ERROR, NOT_ALLOWED_PRIVACY_ENABLED, NOT_ALLOWED_WRONG_USAGE_MODE. - **message** (string) - Extra information from the response. #### Response Example ```json { "vin": "YOUR_VEHICLE_VIN", "statusCode": 200, "invokeStatus": "COMPLETED", "message": "Command executed successfully." } ``` ``` -------------------------------- ### Flash Exterior Lights Command Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/lights-sound Sends a command to flash the vehicle's turn signals. Requires an access token and VCC API key in the request headers. ```bash curl -X POST 'https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/commands/flash' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` -------------------------------- ### List vehicle commands using cURL Source: https://developer.volvocars.com/apis/connected-vehicle/v2/endpoints/commands Retrieves a list of available commands that can be sent to a specific vehicle. Requires a valid access token and VCC API key in the request headers. ```shell curl -X GET 'https://api.volvocars.com/connected-vehicle/v2/vehicles/{vin}/commands' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ``` -------------------------------- ### GET /energy/v2/vehicles/{vin}/state Source: https://developer.volvocars.com/apis/energy/v2/endpoints/energy-state Retrieves the current energy state of a vehicle identified by its VIN. ```APIDOC ## GET /energy/v2/vehicles/{vin}/state ### Description Get the latest energy state of the vehicle, including battery or fuel levels. ### Method GET ### Endpoint https://api.volvocars.com/energy/v2/vehicles/{vin}/state ### Parameters #### Path Parameters - **vin** (string) - Required - The unique Vehicle Identification Number. #### Headers - **authorization** (string) - Required - Bearer - **vcc-api-key** (string) - Required - Your Volvo Cars API key ### Request Example curl -X GET 'https://api.volvocars.com/energy/v2/vehicles/{vin}/state' \ -H 'accept: application/json' \ -H 'authorization: Bearer ' \ -H 'vcc-api-key: ' ### Response #### Success Response (200) - **energyState** (object) - The current energy status of the vehicle. #### Response Example { "vin": "1234567890ABCDEFG", "batteryLevel": 85, "range": 320, "status": "connected" } ```