Documentation

Mistake on this page? Email us

PublicAPIApi

Hierarchy

  • ApiBase
    • PublicAPIApi

Index

Constructors

constructor

  • Parameters

    • Optional options: ConfigOptions
    • Default value responseHandler: function =¬†null
        • (sdkError: SDKError, response: superagent.Response): any
        • Parameters

          • sdkError: SDKError
          • response: superagent.Response

          Returns any

    Returns PublicAPIApi

Methods

complete

  • complete(error: any, response: any, acceptHeader: string, callback?: function): void
  • Parameters

    • error: any
    • response: any
    • acceptHeader: string
    • Optional callback: function
        • Parameters

          Returns any

    Returns void

createBulkDeviceEnrollment

  • createBulkDeviceEnrollment(enrollmentIdentities: any, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Bulk upload With bulk upload you can upload a CSV file containing a number of enrollment IDs. Example usage: ``` curl -X POST \ -H 'Authorization: Bearer <valid access token>' \ -F 'enrollment_identities=@/path/to/enrollments/enrollments.csv' \ https://api.us-east-1.mbedcloud.com/v3/device-enrollments-bulk-uploads ``` Example csv File: 1. First line is assumed to be the header. Content of the header is not validated. 2. Each line can contain comma separated values where 1st value is always assumed to be the Enrollment ID. 3. Only one enrollment ID is expected in one line. 4. Valid Enrollments begins with A followed by a - and 95 charactors in the format as given below. 5. Valid Enrollment identities may be enclosed with in quotes. 6. UTF-8 encoding is expected. ``` &quot;enrollment_identity&quot; &quot;A-4E:63:2D:AE:14:BC:D1:09:77:21:95:44:ED:34:06:57:1E:03:B1:EF:0E:F2:59:44:71:93:23:22:15:43:23:12&quot;, &quot;A-4E:63:2D:AE:14:BC:D1:09:77:21:95:44:ED:34:06:57:1E:03:B1:EF:0E:F2:59:25:48:44:71:22:15:43:23:12&quot;, ```

    Parameters

    • enrollmentIdentities: any

      Enrollment identities CSV file. Maximum file size is 10MB.

    • Optional callback: function
        • (error: any, data?: BulkResponse, response?: superagent.Response): any
        • Parameters

          • error: any
          • Optional data: BulkResponse
          • Optional response: superagent.Response

          Returns any

    • Optional requestOptions: object
      • [key: string]: any

    Returns superagent.SuperAgentRequest

createDeviceEnrollment

  • createDeviceEnrollment(enrollmentIdentity: EnrollmentId, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Place an enrollment claim for one or several devices. When the device connects to the bootstrap server and provides the enrollment ID, it will be assigned to your account. <br> Example usage: ``` curl -X POST \ -H 'Authorization: Bearer <valid access token>' \ -H 'content-type: application/json' \ https://api.us-east-1.mbedcloud.com/v3/device-enrollments \ -d '{&quot;enrollment_identity&quot;: &quot;A-35:e7:72:8a:07:50:3b:3d:75:96:57:52:72:41:0d:78:cc:c6:e5:53:48:c6:65:58:5b:fa:af:4d:2d:73:95:c5&quot;}' ```

    Parameters

    • enrollmentIdentity: EnrollmentId
    • Optional callback: function
        • Parameters

          Returns any

    • Optional requestOptions: object
      • [key: string]: any

    Returns superagent.SuperAgentRequest

currentConfig

  • currentConfig(): object
  • Returns the current configuration of this API module

    Returns object

    • apiKey: any
    • host: any

deleteDeviceEnrollment

  • deleteDeviceEnrollment(id: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Delete an enrollment by ID. To free a device from your account you can delete the enrollment claim. To bypass the device ownership, you need to delete the enrollment and do a factory reset for the device. For more information, see Transferring the ownership using First-to-Claim. <br> Example usage: ``` curl -X DELETE \ -H 'Authorization: Bearer <valid access token>' \ https://api.us-east-1.mbedcloud.com/v3/device-enrollments/{id} ```

    Parameters

    • id: string

      Enrollment identity.

    • Optional callback: function
        • (error: any, data?: any, response?: superagent.Response): any
        • Parameters

          • error: any
          • Optional data: any
          • Optional response: superagent.Response

          Returns any

    • Optional requestOptions: object
      • [key: string]: any

    Returns superagent.SuperAgentRequest

getBulkDeviceEnrollment

  • getBulkDeviceEnrollment(id: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get bulk upload entity Provides info about bulk upload for the given ID. For example bulk status and processed count of enrollment identities. Info includes also links for the bulk upload reports. Example usage: ``` curl -X GET \ -H 'Authorization: Bearer <valid access token>' \ https://api.us-east-1.mbedcloud.com/v3/device-enrollments-bulk-uploads/{id} ```

    Parameters

    • id: string

      Bulk create task entity ID

    • Optional callback: function
        • (error: any, data?: BulkResponse, response?: superagent.Response): any
        • Parameters

          • error: any
          • Optional data: BulkResponse
          • Optional response: superagent.Response

          Returns any

    • Optional requestOptions: object
      • [key: string]: any

    Returns superagent.SuperAgentRequest

getDeviceEnrollment

  • getDeviceEnrollment(id: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get details of an enrollment by ID. To check the enrollment info in detail, for example date of claim and expiration date. Example usage: ``` curl -X GET \ -H 'Authorization: Bearer <valid access token>' \ https://api.us-east-1.mbedcloud.com/v3/device-enrollments/{id} ```

    Parameters

    • id: string

      Enrollment identity.

    • Optional callback: function
        • Parameters

          Returns any

    • Optional requestOptions: object
      • [key: string]: any

    Returns superagent.SuperAgentRequest

getDeviceEnrollments

  • getDeviceEnrollments(limit?: number, after?: string, order?: string, include?: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get enrollment list. Provides a list of pending and claimed enrollments. Example usage: ``` curl -X GET \ -H 'Authorization: Bearer <valid access token>' \ https://api.us-east-1.mbedcloud.com/v3/device-enrollments ``` With query parameters: ``` curl -X GET \ -H 'Authorization: Bearer <valid access token>' \ 'https://api.us-east-1.mbedcloud.com/v3/device-enrollments?limit=10&#39; ```

    Parameters

    • Optional limit: number

      Number of results to be returned. Between 2 and 1000, inclusive.

    • Optional after: string

      Entity ID to fetch after.

    • Optional order: string

      ASC or DESC

    • Optional include: string

      Comma-separated additional data to return. Currently supported: total_count.

    • Optional callback: function
    • Optional requestOptions: object
      • [key: string]: any

    Returns superagent.SuperAgentRequest

request

  • request<T>(options: object, callback?: function): superagent.SuperAgentRequest
  • Type parameters

    • T

    Parameters

    • options: object
      • acceptTypes: Array<string>
      • Optional body?: any
      • contentTypes: Array<string>
      • Optional file?: boolean
      • formParams: __type
      • headers: object
        • [key: string]: string
      • method: string
      • query: __type
      • Optional requestOptions?: object
        • [key: string]: any
      • url: string
      • useFormData: boolean
    • Optional callback: function
        • Parameters

          Returns any

    Returns superagent.SuperAgentRequest