/**
* Samsara API
* # Overview Something new! Welcome Samsara\'s new and improved API. Check out our FAQ [here](https://developers.samsara.com/docs/introducing-our-next-generation-api) to see what\'s changed and learn how to get started.
Want to access the legacy API docs? You can find them [here](https://www.samsara.com/api-legacy).
*Note: Because this is a new set of APIs, we have not transitioned all endpoints over to this standard. Endpoints that still use the legacy standards are indicated in the reference documentation. If you can\'t find an API that you\'re looking for, we encourage you to look for it in our [legacy API docs](https://www.samsara.com/api-legacy) as we continue to transition all endpoints over. Check back here for updates!*
Submit your feedback [here](https://forms.gle/r4bs6HQshQAvBuwv6)! Samsara provides API endpoints so that you can build powerful applications and custom solutions with sensor data. Samsara has endpoints available to track and analyze sensors, vehicles, and entire fleets. The Samsara API is a [RESTful API](https://en.wikipedia.org/wiki/Representational_state_transfer). It uses standard [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) authentication, verbs, and response codes, and it returns [JSON](http://www.json.org/) response bodies. If you\'re familiar with what you can build with a REST API, then this will be your go-to API reference. Visit [developers.samsara.com](https://developers.samsara.com) to find getting started guides and an API overview. If you have any questions, please visit https://samsara.com/help. ## Endpoints All our APIs can be accessed through HTTP requests to URLs like: ``` https://api.samsara.com/ ``` For EU customers, this URL will be: ``` https://api.eu.samsara.com/ ``` Note Legacy endpoints will have the URL: `https://api.samsara.com/v1/` or `https://api.eu.samsara.com/v1/` ## Authentication To authenticate your API request you will need to include your secret token. You can manage your API tokens in the [Dashboard](https://cloud.samsara.com). They are visible under `Settings->Organization->API Tokens`. Your API tokens carry many privileges, so be sure to keep them secure. Do not share your secret API tokens in publicly accessible areas such as GitHub, client-side code, and so on. Authentication to the API is performed via Bearer Token in the HTTP Authorization header. Provide your API token as the `access_token` value in an `Authorization: Bearer` header. You do not need to provide a password: ```curl Authorization: Bearer {access_token} ``` All API requests must be made over [HTTPS](https://en.wikipedia.org/wiki/HTTPS). Calls made over plain HTTP or without authentication will fail. ### OAuth2 If building an application for our marketplace, our API is accessible via. OAuth2 as well. | Type | Value | | ------------- |:-------------:| | Security scheme | OAuth2 | | OAuth2 Flow | accessCode | | Authorization URL | https://api.samsara.com/oauth2/authorize | | Token URL | https://api.samsara.com/oauth2/token | ## Common Patterns You can find more info about request methods, response codes, error codes, versioning, pagination, timestamps, and mini-objects [here](https://developers.samsara.com/docs/common-structures).
*
* The version of the OpenAPI document: 2024-11-18
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import { RequestArgs, BaseAPI } from '../base';
import { AttributeExpandedResponse } from '../samsara-models';
import { CreateAttributeRequest } from '../samsara-models';
import { GetAttributesByEntityTypeResponse } from '../samsara-models';
import { UpdateAttributeRequest } from '../samsara-models';
/**
* AttributesApi - axios parameter creator
* @export
*/
export declare const AttributesApiAxiosParamCreator: (configuration?: Configuration) => {
/**
* Creates a new attribute in the organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Create an attribute
* @param {CreateAttributeRequest} attribute The attribute to create.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAttribute: (attribute: CreateAttributeRequest, options?: RawAxiosRequestConfig) => Promise;
/**
* Delete an attribute by id, including all of its applications. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Deleting an attribute
* @param {string} id Samsara-provided UUID of the attribute.
* @param {DeleteAttributeEntityTypeEnum} entityType Denotes the type of entity, driver or asset.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAttribute: (id: string, entityType: DeleteAttributeEntityTypeEnum, options?: RawAxiosRequestConfig) => Promise;
/**
* Fetch an attribute by id, including all of its applications. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Retrieve an attribute
* @param {string} id Samsara-provided UUID of the attribute.
* @param {GetAttributeEntityTypeEnum} entityType Denotes the type of entity, driver or asset.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAttribute: (id: string, entityType: GetAttributeEntityTypeEnum, options?: RawAxiosRequestConfig) => Promise;
/**
* Fetch all attributes in an organization associated with either drivers or assets. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary List all attributes by entity type
* @param {GetAttributesByEntityTypeEntityTypeEnum} entityType Denotes the type of entity, driver or asset.
* @param {number} [limit] The limit for how many objects will be in the response. Default and max for this value is 512 objects.
* @param {string} [after] If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAttributesByEntityType: (entityType: GetAttributesByEntityTypeEntityTypeEnum, limit?: number, after?: string, options?: RawAxiosRequestConfig) => Promise;
/**
* Updates an attribute in the organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Update an attribute
* @param {string} id Samsara-provided UUID of the attribute.
* @param {UpdateAttributeRequest} attribute The attribute to update.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateAttribute: (id: string, attribute: UpdateAttributeRequest, options?: RawAxiosRequestConfig) => Promise;
};
/**
* AttributesApi - functional programming interface
* @export
*/
export declare const AttributesApiFp: (configuration?: Configuration) => {
/**
* Creates a new attribute in the organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Create an attribute
* @param {CreateAttributeRequest} attribute The attribute to create.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAttribute(attribute: CreateAttributeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>;
/**
* Delete an attribute by id, including all of its applications. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Deleting an attribute
* @param {string} id Samsara-provided UUID of the attribute.
* @param {DeleteAttributeEntityTypeEnum} entityType Denotes the type of entity, driver or asset.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAttribute(id: string, entityType: DeleteAttributeEntityTypeEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>;
/**
* Fetch an attribute by id, including all of its applications. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Retrieve an attribute
* @param {string} id Samsara-provided UUID of the attribute.
* @param {GetAttributeEntityTypeEnum} entityType Denotes the type of entity, driver or asset.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAttribute(id: string, entityType: GetAttributeEntityTypeEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>;
/**
* Fetch all attributes in an organization associated with either drivers or assets. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary List all attributes by entity type
* @param {GetAttributesByEntityTypeEntityTypeEnum} entityType Denotes the type of entity, driver or asset.
* @param {number} [limit] The limit for how many objects will be in the response. Default and max for this value is 512 objects.
* @param {string} [after] If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAttributesByEntityType(entityType: GetAttributesByEntityTypeEntityTypeEnum, limit?: number, after?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>;
/**
* Updates an attribute in the organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Update an attribute
* @param {string} id Samsara-provided UUID of the attribute.
* @param {UpdateAttributeRequest} attribute The attribute to update.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateAttribute(id: string, attribute: UpdateAttributeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>;
};
/**
* AttributesApi - factory interface
* @export
*/
export declare const AttributesApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
/**
* Creates a new attribute in the organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Create an attribute
* @param {AttributesApiCreateAttributeRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAttribute(requestParameters: AttributesApiCreateAttributeRequest, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Delete an attribute by id, including all of its applications. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Deleting an attribute
* @param {AttributesApiDeleteAttributeRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAttribute(requestParameters: AttributesApiDeleteAttributeRequest, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Fetch an attribute by id, including all of its applications. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Retrieve an attribute
* @param {AttributesApiGetAttributeRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAttribute(requestParameters: AttributesApiGetAttributeRequest, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Fetch all attributes in an organization associated with either drivers or assets. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary List all attributes by entity type
* @param {AttributesApiGetAttributesByEntityTypeRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAttributesByEntityType(requestParameters: AttributesApiGetAttributesByEntityTypeRequest, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Updates an attribute in the organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Update an attribute
* @param {AttributesApiUpdateAttributeRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateAttribute(requestParameters: AttributesApiUpdateAttributeRequest, options?: RawAxiosRequestConfig): AxiosPromise;
};
/**
* Request parameters for createAttribute operation in AttributesApi.
* @export
* @interface AttributesApiCreateAttributeRequest
*/
export interface AttributesApiCreateAttributeRequest {
/**
* The attribute to create.
* @type {CreateAttributeRequest}
* @memberof AttributesApiCreateAttribute
*/
readonly attribute: CreateAttributeRequest;
}
/**
* Request parameters for deleteAttribute operation in AttributesApi.
* @export
* @interface AttributesApiDeleteAttributeRequest
*/
export interface AttributesApiDeleteAttributeRequest {
/**
* Samsara-provided UUID of the attribute.
* @type {string}
* @memberof AttributesApiDeleteAttribute
*/
readonly id: string;
/**
* Denotes the type of entity, driver or asset.
* @type {'driver' | 'asset'}
* @memberof AttributesApiDeleteAttribute
*/
readonly entityType: DeleteAttributeEntityTypeEnum;
}
/**
* Request parameters for getAttribute operation in AttributesApi.
* @export
* @interface AttributesApiGetAttributeRequest
*/
export interface AttributesApiGetAttributeRequest {
/**
* Samsara-provided UUID of the attribute.
* @type {string}
* @memberof AttributesApiGetAttribute
*/
readonly id: string;
/**
* Denotes the type of entity, driver or asset.
* @type {'driver' | 'asset'}
* @memberof AttributesApiGetAttribute
*/
readonly entityType: GetAttributeEntityTypeEnum;
}
/**
* Request parameters for getAttributesByEntityType operation in AttributesApi.
* @export
* @interface AttributesApiGetAttributesByEntityTypeRequest
*/
export interface AttributesApiGetAttributesByEntityTypeRequest {
/**
* Denotes the type of entity, driver or asset.
* @type {'driver' | 'asset'}
* @memberof AttributesApiGetAttributesByEntityType
*/
readonly entityType: GetAttributesByEntityTypeEntityTypeEnum;
/**
* The limit for how many objects will be in the response. Default and max for this value is 512 objects.
* @type {number}
* @memberof AttributesApiGetAttributesByEntityType
*/
readonly limit?: number;
/**
* If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.
* @type {string}
* @memberof AttributesApiGetAttributesByEntityType
*/
readonly after?: string;
}
/**
* Request parameters for updateAttribute operation in AttributesApi.
* @export
* @interface AttributesApiUpdateAttributeRequest
*/
export interface AttributesApiUpdateAttributeRequest {
/**
* Samsara-provided UUID of the attribute.
* @type {string}
* @memberof AttributesApiUpdateAttribute
*/
readonly id: string;
/**
* The attribute to update.
* @type {UpdateAttributeRequest}
* @memberof AttributesApiUpdateAttribute
*/
readonly attribute: UpdateAttributeRequest;
}
/**
* AttributesApi - object-oriented interface
* @export
* @class AttributesApi
* @extends {BaseAPI}
*/
export declare class AttributesApi extends BaseAPI {
/**
* Creates a new attribute in the organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Create an attribute
* @param {AttributesApiCreateAttributeRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AttributesApi
*/
createAttribute(requestParameters: AttributesApiCreateAttributeRequest, options?: RawAxiosRequestConfig): Promise>;
/**
* Delete an attribute by id, including all of its applications. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Deleting an attribute
* @param {AttributesApiDeleteAttributeRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AttributesApi
*/
deleteAttribute(requestParameters: AttributesApiDeleteAttributeRequest, options?: RawAxiosRequestConfig): Promise>;
/**
* Fetch an attribute by id, including all of its applications. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Retrieve an attribute
* @param {AttributesApiGetAttributeRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AttributesApi
*/
getAttribute(requestParameters: AttributesApiGetAttributeRequest, options?: RawAxiosRequestConfig): Promise>;
/**
* Fetch all attributes in an organization associated with either drivers or assets. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Read Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary List all attributes by entity type
* @param {AttributesApiGetAttributesByEntityTypeRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AttributesApi
*/
getAttributesByEntityType(requestParameters: AttributesApiGetAttributesByEntityTypeRequest, options?: RawAxiosRequestConfig): Promise>;
/**
* Updates an attribute in the organization. **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team. To use this endpoint, select **Write Attributes** under the Setup & Administration category when creating or editing an API token. Learn More.
* @summary Update an attribute
* @param {AttributesApiUpdateAttributeRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AttributesApi
*/
updateAttribute(requestParameters: AttributesApiUpdateAttributeRequest, options?: RawAxiosRequestConfig): Promise>;
}
/**
* @export
*/
export declare const DeleteAttributeEntityTypeEnum: {
readonly Driver: "driver";
readonly Asset: "asset";
};
export type DeleteAttributeEntityTypeEnum = typeof DeleteAttributeEntityTypeEnum[keyof typeof DeleteAttributeEntityTypeEnum];
/**
* @export
*/
export declare const GetAttributeEntityTypeEnum: {
readonly Driver: "driver";
readonly Asset: "asset";
};
export type GetAttributeEntityTypeEnum = typeof GetAttributeEntityTypeEnum[keyof typeof GetAttributeEntityTypeEnum];
/**
* @export
*/
export declare const GetAttributesByEntityTypeEntityTypeEnum: {
readonly Driver: "driver";
readonly Asset: "asset";
};
export type GetAttributesByEntityTypeEntityTypeEnum = typeof GetAttributesByEntityTypeEntityTypeEnum[keyof typeof GetAttributesByEntityTypeEntityTypeEnum];