PowerPlatformConnectors/certified-connectors/CDK Drive Service Vehicles/apiDefinition.swagger.json

930 строки
26 KiB
JSON

{
"swagger": "2.0",
"info": {
"title": "CDK Drive Service Vehicles",
"version": "1.0",
"description": "CDK Drive Service Vehicles Associates identification, type, status, and customer information about a vehicle. The API will allow you to create, update, query, and retrieve service domain vehicle information in CDK.",
"contact": {
"name": "CDK Global",
"url": "https://serviceconnect.support.cdk.com",
"email": "mbd_support@cdk.com"
}
},
"host": "cdkapi.azure-api.net",
"basePath": "/vehicles",
"schemes": [
"https"
],
"consumes": [],
"produces": [],
"paths": {
"/": {
"get": {
"description": "Query vehicles",
"operationId": "queryVehicles",
"summary": "Query vehicles",
"tags": [
"query"
],
"parameters": [
{
"name": "vin",
"in": "query",
"description": "Filters vehicles by VIN",
"type": "string",
"x-ms-summary": "Vin"
},
{
"name": "licensePlateNum",
"in": "query",
"description": "Filters vehicles by license plate number",
"type": "string",
"x-ms-summary": "License Plate Number"
},
{
"name": "customerId",
"in": "query",
"description": "Filters vehicles by customerId",
"type": "string",
"x-ms-summary": "Customer Id"
},
{
"name": "subscription_id",
"in": "query",
"description": "A correlation ID that should be returned back to the caller to indicate the return of the given request.",
"required": true,
"type": "string",
"x-ms-summary": "Subscription Id"
},
{
"name": "client_id",
"in": "query",
"description": "A client ID that should be unique to developer/solution provider building the solution.",
"required": true,
"type": "string",
"x-ms-summary": "Client Id"
},
{
"name": "client_secret",
"in": "query",
"description": "A client secret that should be unique to developer/solution provider building the solution.",
"required": true,
"type": "string",
"x-ms-summary": "Client Secret"
},
{
"name": "Request-Id",
"in": "header",
"description": "Format - guid. A correlation ID that should be returned back to the caller to indicate the return of the given request",
"type": "string",
"x-ms-summary": "Request Id"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OK",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/VehicleCollection"
}
},
"400": {
"description": "400 - Bad Request",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"401": {
"description": "401 - Unauthorized",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"403": {
"description": "403 - Forbidden",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
},
"post": {
"description": "Create a vehicle",
"operationId": "createVehicle",
"summary": "Create a vehicle",
"tags": [
"create"
],
"parameters": [
{
"name": "client_id",
"in": "query",
"description": "A client ID that should be unique to developer/solution provider building the solution.",
"required": true,
"type": "string",
"x-ms-summary": "Client Id"
},
{
"name": "client_secret",
"in": "query",
"description": "A client secret that should be unique to developer/solution provider building the solution.",
"required": true,
"type": "string",
"x-ms-summary": "Client Secret"
},
{
"name": "subscription_id",
"in": "query",
"description": "A correlation ID that should be returned back to the caller to indicate the return of the given request.",
"required": true,
"type": "string",
"x-ms-summary": "Subscription Id"
},
{
"name": "Request-Id",
"in": "header",
"description": "Format - guid. A correlation ID that should be returned back to the caller to indicate the return of the given request",
"required": true,
"type": "string",
"x-ms-summary": "Request Id"
},
{
"name": "createVehicle",
"in": "body",
"schema": {
"$ref": "#/definitions/CreateVehicle"
},
"description": "The vehicle definition"
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"201": {
"description": "Created",
"headers": {
"Request-Id": {
"type": "string"
},
"ETag": {
"type": "string",
"description": "The computed checksum of the resource"
}
},
"schema": {
"$ref": "#/definitions/Vehicle"
}
},
"400": {
"description": "400 - Bad Request",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"401": {
"description": "401 - Unauthorized",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"403": {
"description": "403 - Forbidden",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
}
},
"/{vehicleId}/": {
"get": {
"description": "Query a vehicle by identifier",
"operationId": "queryVehicleById",
"summary": "Query a vehicle by identifier",
"tags": [
"query"
],
"parameters": [
{
"name": "vehicleId",
"in": "path",
"description": "The vehicle identifier",
"required": true,
"type": "string",
"x-ms-summary": "Vehicle Id"
},
{
"name": "subscription_id",
"in": "query",
"description": "A correlation ID that should be returned back to the caller to indicate the return of the given request.",
"required": true,
"type": "string",
"x-ms-summary": "Subscription Id"
},
{
"name": "client_id",
"in": "query",
"description": "A client ID that should be unique to developer/solution provider building the solution.",
"required": true,
"type": "string",
"x-ms-summary": "Client Id"
},
{
"name": "client_secret",
"in": "query",
"description": "A client secret that should be unique to developer/solution provider building the solution.",
"required": true,
"type": "string",
"x-ms-summary": "Client Secret"
},
{
"name": "Request-Id",
"in": "header",
"description": "Format - guid. A correlation ID that should be returned back to the caller to indicate the return of the given request",
"type": "string",
"x-ms-summary": "Request Id"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OK",
"headers": {
"Request-Id": {
"type": "string"
},
"ETag": {
"type": "string",
"description": "The computed checksum of the resource"
}
},
"schema": {
"$ref": "#/definitions/Vehicle"
}
},
"400": {
"description": "400 - Bad Request",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"401": {
"description": "401 - Unauthorized",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"403": {
"description": "403 - Forbidden",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"404": {
"description": "404 - Not Found",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
},
"post": {
"description": "Update a vehicle",
"operationId": "updateVehicle",
"summary": "Update a vehicle",
"tags": [
"update"
],
"parameters": [
{
"name": "vehicleId",
"in": "path",
"description": "The vehicle identifier",
"required": true,
"type": "string",
"x-ms-summary": "Vehicle Id"
},
{
"name": "subscription_id",
"in": "query",
"description": "A correlation ID that should be returned back to the caller to indicate the return of the given request.",
"required": true,
"type": "string",
"x-ms-summary": "Subscription Id"
},
{
"name": "client_id",
"in": "query",
"description": "A client ID that should be unique to developer/solution provider building the solution.",
"required": true,
"type": "string",
"x-ms-summary": "Client Id"
},
{
"name": "client_secret",
"in": "query",
"description": "A client secret that should be unique to developer/solution provider building the solution.",
"required": true,
"type": "string",
"x-ms-summary": "Client Secret"
},
{
"name": "Request-Id",
"in": "header",
"description": "Format - guid. A correlation ID that should be returned back to the caller to indicate the return of the given request",
"type": "string",
"x-ms-summary": "Request Id"
},
{
"name": "If-Match",
"in": "header",
"description": "Makes the resource update request conditional. The checksum value \npresented with If-Match must match the current ETag value of the \nresource.\n",
"required": true,
"type": "string",
"x-ms-summary": "eTag Value"
},
{
"name": "createVehicle",
"in": "body",
"schema": {
"$ref": "#/definitions/CreateVehicle"
},
"description": "The vehicle definition"
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OK",
"headers": {
"Request-Id": {
"type": "string"
},
"ETag": {
"type": "string",
"description": "The computed checksum of the resource"
}
},
"schema": {
"$ref": "#/definitions/Vehicle"
}
},
"400": {
"description": "400 - Bad Request",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"401": {
"description": "401 - Unauthorized",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"403": {
"description": "403 - Forbidden",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"404": {
"description": "404 - Not Found",
"headers": {
"Request-Id": {
"type": "string"
}
},
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
}
}
},
"x-ms-connector-metadata": [
{
"propertyName": "Website",
"propertyValue": "https://fortellis.io"
},
{
"propertyName": "Privacy policy",
"propertyValue": "https://fortellis.io/privacy"
},
{
"propertyName": "Categories",
"propertyValue": "Data"
}
],
"definitions": {
"Vehicle": {
"type": "object",
"properties": {
"vehicleId": {
"type": "string",
"description": "The idenifier of the vehicle record"
},
"identification": {
"$ref": "#/definitions/VehicleIdentification",
"description": "Unique vehicle identifiers"
},
"specification": {
"$ref": "#/definitions/VehicleSpecification",
"description": "The make/model/year specification"
},
"exteriorColor": {
"type": "string",
"description": "The vehicle exterior color"
},
"mileage": {
"$ref": "#/definitions/Measurement",
"description": "The vehicle mileage"
},
"status": {
"type": "string",
"enum": [
"NEW",
"USED",
"CERTIFIED"
],
"description": "Is the status of the vehicle new, used, or certified?"
},
"dates": {
"$ref": "#/definitions/Dates"
},
"ownerHref": {
"type": "string",
"description": "The hyperlink to the owner customer resource"
},
"primaryDriverHref": {
"type": "string",
"description": "The hyperlink to the primary driver customer resource"
},
"links": {
"$ref": "#/definitions/VehicleLinks",
"description": "The hypermedia links of the customer resource"
}
},
"required": [
"vehicleId",
"identification",
"specification",
"status",
"dates",
"links"
],
"example": {
"vehicleId": "1234ABCD",
"identification": {
"vin": "5TFAW5F19EX759955",
"licensePlateNum": "1ABC123"
},
"specification": {
"makeCode": "TOY",
"make": "Toyota",
"modelCode": "TUNDRA",
"model": "Tundra",
"modelYear": 2014
},
"exteriorColor": "BLACK",
"mileage": {
"value": 56700,
"units": "MI"
},
"status": "USED",
"dates": {
"delivered": "2019-01-01",
"inService": "2014-01-01",
"warrantyExpiration": ""
},
"ownerHref": "https://api.fortellis.io/cdkdrive/crm/v1/customers/RGHH6755",
"primaryDriverHref": "https://api.fortellis.io/cdkdrive/crm/v1/customers/AUHYG78835",
"links": {
"self": {
"href": "https://api.fortellis.io/cdkdrive/service/vehicles/1234ABCD"
}
}
}
},
"VehicleIdentification": {
"description": "Vehicle identification. At least one of the identification properties must be defined for the entity to be valid.",
"type": "object",
"properties": {
"vin": {
"type": "string",
"description": "The Vehicle Idenitification Number"
},
"licensePlateNum": {
"type": "string",
"description": "The vehicle license plate number"
}
},
"example": {
"vin": "5TFAW5F19EX759955",
"licensePlateNum": "1ABC123"
}
},
"VehicleLinks": {
"type": "object",
"properties": {
"self": {
"$ref": "#/definitions/LinkDescriptionObject"
}
},
"required": [
"self"
],
"example": {
"self": {
"href": "https://api.fortellis.io/cdkdrive/service/vehicles/1234ABCD"
}
}
},
"VehicleCollection": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/Vehicle"
}
}
},
"required": [
"items"
],
"example": {
"items": [
{
"vehicleId": "1234ABCD",
"identification": {
"vin": "5TFAW5F19EX759955",
"licensePlateNum": "1ABC123"
},
"specification": {
"makeCode": "TOY",
"make": "Toyota",
"modelCode": "TUNDRA",
"model": "Tundra",
"modelYear": 2014
},
"exteriorColor": "BLACK",
"mileage": {
"value": 56700,
"units": "MI"
},
"status": "USED",
"dates": {
"delivered": "2019-01-01",
"inService": "2014-01-01",
"warrantyExpiration": ""
},
"ownerHref": "https://api.fortellis.io/cdkdrive/crm/v1/customers/RGHH6755",
"primaryDriverHref": "https://api.fortellis.io/cdkdrive/crm/v1/customers/AUHYG78835",
"links": {
"self": {
"href": "https://api.fortellis.io/cdkdrive/service/vehicles/1234ABCD"
}
}
},
{
"vehicleId": "6789WXYZ",
"identification": {
"vin": "JF1GR7E64DG203230",
"licensePlateNum": "9XYZ789"
},
"specification": {
"makeCode": "SUB",
"make": "Subaru",
"modelCode": "IMPREZ",
"model": "Impreza",
"modelYear": 2013
},
"exteriorColor": "BLUE",
"mileage": {
"value": 77890,
"units": "MI"
},
"status": "CERTIFIED",
"certified": false,
"dates": {
"delivered": "2013-05-01",
"inService": "2013-05-01",
"warrantyExpiration": "2020-05-01"
},
"ownerHref": "https://api.fortellis.io/cdkdrive/crm/v1/customers/GHJJ67788",
"primaryDriverHref": "https://api.fortellis.io/cdkdrive/crm/v1/customers/FHKJ4612",
"links": {
"self": {
"href": "https://api.fortellis.io/cdkdrive/service/vehicles/6789WXYZ"
}
}
}
]
}
},
"CreateVehicle": {
"type": "object",
"properties": {
"identification": {
"$ref": "#/definitions/VehicleIdentification",
"description": "Unique vehicle identifiers"
},
"specification": {
"$ref": "#/definitions/VehicleSpecification",
"description": "The make/model/year specification"
},
"exteriorColor": {
"type": "string",
"description": "The vehicle exterior color"
},
"mileage": {
"$ref": "#/definitions/Measurement",
"description": "The vehicle mileage"
},
"status": {
"type": "string",
"enum": [
"NEW",
"USED",
"CERTIFIED"
],
"description": "Is the status of the vehicle new, used, or certified?"
},
"dates": {
"$ref": "#/definitions/Dates"
},
"ownerHref": {
"type": "string",
"description": "The hyperlink to the owner customer resource"
},
"primaryDriverHref": {
"type": "string",
"description": "The hyperlink to the primary driver customer resource"
}
},
"required": [
"identification",
"specification",
"status",
"dates"
],
"example": {
"identification": {
"vin": "5TFAW5F19EX759955",
"licensePlateNum": "1ABC123"
},
"specification": {
"makeCode": "TOY",
"modelCode": "TUNDRA",
"modelYear": 2014
},
"exteriorColor": "BLACK",
"mileage": {
"value": 56700,
"units": "MI"
},
"status": "USED",
"dates": {
"delivered": "2019-01-01",
"inService": "2014-01-01",
"warrantyExpiration": ""
},
"ownerHref": "https://api.fortellis.io/cdkdrive/crm/v1/customers/RGHH6755",
"primaryDriverHref": "https://api.fortellis.io/cdkdrive/crm/v1/customers/AUHYG78835"
}
},
"VehicleSpecification": {
"type": "object",
"properties": {
"makeCode": {
"type": "string",
"description": "The vehicle make code"
},
"make": {
"type": "string",
"description": "The vehicle make name"
},
"modelCode": {
"type": "string",
"description": "The vehicle model code"
},
"model": {
"type": "string",
"description": "The vehicle model name"
},
"modelYear": {
"type": "number",
"description": "The vehicle model year"
}
},
"required": [
"makeCode",
"modelCode",
"modelYear"
],
"example": {
"makeCode": "TOY",
"make": "Toyota",
"modelCode": "CAM",
"model": "Camry",
"modelYear": 2017
}
},
"Measurement": {
"type": "object",
"properties": {
"value": {
"type": "number",
"description": "The measurement value"
},
"units": {
"type": "string",
"enum": [
"MI",
"KM"
],
"description": "The units of measurement"
}
},
"required": [
"value",
"units"
],
"example": {
"value": 1024,
"units": "KM"
}
},
"Dates": {
"type": "object",
"properties": {
"delivered": {
"type": "string",
"format": "date",
"description": "Delivery date of the vehicle to its current owner as defined by RFC 3339, section 5.6, for example, 2017-07-21"
},
"inService": {
"type": "string",
"format": "date",
"description": "Retail sale date to the original owner as defined by RFC 3339, section 5.6, for example, 2017-07-21"
},
"warrantyExpiration": {
"type": "string",
"format": "date",
"description": "Warranty Expiration date of the vehicle as defined by RFC 3339, section 5.6, for example, 2017-07-21"
}
},
"required": [
"delivered",
"inService"
],
"example": {
"delivered": "2019-01-01T00:00:00Z",
"inService": "2014-01-01T00:00:00Z",
"warrantyExpiration": "2020-01-01T00:00:00Z"
}
},
"LinkDescriptionObject": {
"title": "Details of a link to a resource",
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The target URI"
},
"method": {
"type": "string",
"description": "The HTTP verb that MUST be used to make a request to the target of the link"
},
"title": {
"type": "string",
"description": "The title property provides a title for the link and is a helpful documentation tool to facilitate understanding by the end clients"
}
},
"required": [
"href"
],
"example": {
"href": "https://api.fortellis.io/cdkdrive/service/v1/vehicles/1234ABCD",
"method": "GET"
}
},
"ErrorResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"example": {
"code": 400,
"message": "Bad Request - Missing \"vehicleId\" path parameter."
}
}
},
"parameters": {},
"responses": {},
"securityDefinitions": {},
"security": [
{
"apiKeyHeader": []
},
{
"apiKeyQuery": []
}
],
"tags": []
}