Documentation

Mistake on this page? Email us

EndpointsApi

Hierarchy

  • ApiBase
    • EndpointsApi

Index

Constructors

constructor

  • Parameters

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

          • sdkError: SDKError
          • response: superagent.Response

          Returns any

    Returns EndpointsApi

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

currentConfig

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

    Returns object

    • apiKey: any
    • host: any

getConnectedEndpoints

  • getConnectedEndpoints(type?: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • (DEPRECATED) List registered endpoints. The number of returned endpoints is currently limited to 200. Endpoints are physical devices having valid registration to Device Management. All devices regardless of registration status can be requested from Device Directory API '/v3/devices/`. Note: This endpoint is deprecated and will be removed 1Q/18. You should use the Device Directory API `/v3/devices/`. To list only the registered devices, use filter `/v3/devices/?filter=state%3Dregistered`. Example usage: curl -X GET https://api.us-east-1.mbedcloud.com/v2/endpoints -H 'authorization: Bearer {api-key}'

    Parameters

    • Optional type: string

      Filter endpoints by endpoint-type.

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

          • error: any
          • Optional data: Array<Endpoint>
          • Optional response: superagent.Response

          Returns any

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

    Returns superagent.SuperAgentRequest

getEndpointResources

  • getEndpointResources(deviceId: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • List the resources on an endpoint The list of resources is cached by Device Management Connect, so this call does not create a message to the device. Example usage: curl -X GET https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id} -H 'authorization: Bearer {api-key}'

    Parameters

    • deviceId: string

      A unique device ID for an endpoint. Note that the ID needs to be an exact match. You cannot use wildcards here.

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

          • error: any
          • Optional data: Array<Resource>
          • Optional response: superagent.Response

          Returns any

    • 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