Documentation

Mistake on this page? Email us

Hierarchy

  • EnrollmentApi

Index

Constructors

constructor

  • The API can be initalized with a .env file in the working directory with the following values

    MBED_CLOUD_SDK_API_KEY=

    and optionally

    MBED_CLOUD_SDK_HOST= (defaults to https://api.us-east-1.mbedcloud.com)

    OR

    This API is initialized with ConnectionOptions.

    To create an instance of this API in Node.js:

    var PelionDMSDK = require("mbed-cloud-sdk");
    
    var update = new PelionDMSDK.UpdateApi({
        apiKey: "<Pelion DM API Key>"
    });

    To create an instance of this API in the browser:

    <script src="<pelion-dm-sdk>/bundles/update.min.js"></script>
    
    <script>
        var update = new MbedCloudSDK.UpdateApi({
            apiKey: "<Pelion DM API Key>"
        });
    </script>

    Parameters

    Returns EnrollmentApi

Methods

addEnrollmentClaim

  • Place an enrollment claim for a device.

    Example:

    enrollment.addEnrollmentClaim({
        claimId: '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'
    })
    .then(enrollmentClaim => {
        // Utilize claim here
    })
    .catch(error => {
        console.log(error);
    });

    Parameters

    Returns Promise<EnrollmentClaim>

    Promise of enrollment claim

  • Place an enrollment claim for a device.

    Example:

    enrollment.addEnrollmentClaim({
        claimId: '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'
    }, function(error, enrollmentClaim) {
        if (error) throw error;
        // Utilize enrollment claim here
    });

    Parameters

    Returns void

deleteEnrollmentClaim

  • deleteEnrollmentClaim(claimId: string): Promise<void>
  • Delete an enrollment claim.

    Example:

    enrollment.deleteEnrollmentClaim('sckv52bebji8dxnxuw3zvnon95u8gshm')
    .catch(error => {
        console.log(error);
    });

    Parameters

    • claimId: string

      Enrollment claim ID

    Returns Promise<void>

    Promise containing any error

  • deleteEnrollmentClaim(claimId: string, callback: CallbackFn<void>): void
  • Delete an enrollment claim.

    Example:

    enrollment.deleteEnrollmentClaim('sckv52bebji8dxnxuw3zvnon95u8gshm')
        if (error) throw error;
    });

    Parameters

    • claimId: string

      Device ID

    • callback: CallbackFn<void>

      A function that is passed any error

    Returns void

getEnrollmentClaim

  • Gets details of an enrollment.

    Example:

    enrollment.getEnrollmentClaim('sckv52bebji8dxnxuw3zvnon95u8gshm'')
    .then(enrollmentClaim => {
        // Utilize enrollment claim here
    })
    .catch(error => {
        console.log(error);
    });

    Parameters

    • claimId: string

      Enrollment claim ID

    Returns Promise<EnrollmentClaim>

    Promise of enrollment claim

  • Gets details of an enrollment.

    Example:

    enrollment.getEnrollmentClaim('sckv52bebji8dxnxuw3zvnon95u8gshm', function(error, enrollmentClaim) {
        if (error) throw error;
        // Utilize claim here
    });

    Parameters

    • claimId: string

      Enrollment claim ID

    • callback: CallbackFn<EnrollmentClaim>

      A function that is passed the arguments (error, enrollmentClaim)

    Returns void

getLastApiMetadata

  • getLastApiMetadata(): Promise<ApiMetadata>
  • Get meta data for the last Pelion Device Management API call

    Returns Promise<ApiMetadata>

    Promise of meta data

  • getLastApiMetadata(callback: CallbackFn<ApiMetadata>): void
  • Get meta data for the last Pelion Device Management API call

    Parameters

    • callback: CallbackFn<ApiMetadata>

      A function that is passed the arguments (error, meta data)

    Returns void

listEnrollmentClaims

  • Get enrollment list.

    Example:

    enrollment.listEnrollmentClaims({
        limit: 100
    })
    .then(claims => {
        // Utilize claims here
    })
    .catch(error => {
        console.log(error);
    });

    Parameters

    Returns Promise<ListResponse<EnrollmentClaim>>

    Promise of devices

  • Get enrollment list.

    Example:

    enrollment.listEnrollmentClaims({
        limit: 100
    }, function(error, claims) {
        if (error) throw error;
        // Utilize claims here
    });

    Parameters

    Returns void