swagger: '2.0' info: title: 'Einride Extend: Authentication AuthenticationService API' description: "Based on REST principles, with optional support for gRPC, the Einride Extend API enables modern API-based integration to Einride Saga.\n\nAPI design\n----------\n\nThe Einride Extend APIs are designed using the [AIP](https://aip.dev) design framework, which means that they are resource-oriented and work like standard [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) APIs.\n\n### Resource-oriented design\n\n*See also: [AIP-121: Resource-oriented design](https://google.aip.dev/121)*\n\nThe fundamental building blocks of this API are individually-named resources (nouns) and the relationships and hierarchy that exist between them.\n\nA number of standard methods (verbs) provide the semantics for common [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations. Custom methods are available where custom operations are required, such as for cancelling shipments.\n\n### Resource names\n\n*See also: [AIP-122: Resource names](https://google.aip.dev/122)*\n\nThis API exposes resources which users are able to create, retrieve, and manipulate. Resources are named: each resource has a unique identifier that users use to reference that resource, and these names are what users should store as the canonical names for the resources.\n\nAs such, the unique identifier for a resource in this API is called a *resource name*.\n\nProtocols\n---------\n\nThe Einride Extend APIs support both HTTP and gRPC protocols.\n\n### HTTP\n\nThe Einride Extend APIs are available as RESTful HTTP endpoints.\n\nSee this document for the OpenAPI specifications, or use the API documentation at [extend.saga.einride.tech](https://extend.saga.einride.tech), where you can also try out the REST APIs and make example requests.\n\n### gRPC\n\n[gRPC](https://grpc.io) is a high performance, open source universal RPC framework that works across programming languages and platforms.\n\nTo for more information about using Einride Extend APIs via gRPC, please contact your Einride representative.\n\nAuthentication\n---------\n\nThe Einride Extend use standard [Bearer token authentication](https://swagger.io/docs/specification/authentication/bearer-authentication/). When using the HTTP APIs, make sure to always provide the following header in all requests:\n\n\n Authorization: Bearer \n\n\nWhere `` is the authentication token for your integration. \n\n\nObtain a short-lived authentication token by using the ExchangeSecret API documented below. \n\n\nPlease contact your Einride representative to obtain a client ID and client secret for your integration. \n\nAPI address\n---------\n\nThe Einride Extend API is available via the following root address:\n\nhttps://api.saga.einride.tech\n" version: v1beta1 schemes: - https consumes: - application/json produces: - application/json tags: - name: AuthenticationService paths: /v1beta1/auth:exchangeSecret: post: summary: Exchange secret for access token. operationId: AuthenticationService_ExchangeSecret responses: '200': description: A successful response. schema: $ref: '#/definitions/v1beta1ExchangeSecretResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/rpcStatus' parameters: - name: body description: Request to the ExchangeSecret method. in: body required: true schema: $ref: '#/definitions/v1beta1ExchangeSecretRequest' tags: - AuthenticationService definitions: protobufAny: type: object properties: '@type': type: string additionalProperties: {} rpcStatus: type: object properties: code: type: integer format: int32 message: type: string details: type: array items: type: object $ref: '#/definitions/protobufAny' v1beta1ExchangeSecretResponse: type: object properties: accessToken: type: string description: 'Access token to pass as a Bearer token in the authorization header on subsequent API calls.' expireTime: type: string format: date-time description: Expire time of the access token. readOnly: true description: Response from the ExchangeSecret method. v1beta1ExchangeSecretRequest: type: object properties: clientId: type: string format: string description: The client ID. clientSecret: type: string format: password description: The client secret. description: Request to the ExchangeSecret method. required: - clientId - clientSecret