Documentation

Mistake on this page? Email us

DeveloperApi

Hierarchy

  • ApiBase
    • DeveloperApi

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 DeveloperApi

Methods

addMyApiKeyToGroups

  • addMyApiKeyToGroups(body: Array<string>, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Add API key to a list of groups. An endpoint for adding API key to groups. Example usage: `curl -X POST https://api.us-east-1.mbedcloud.com/v3/api-keys/me/groups -d '[0162056a9a1586f30242590700000000,0117056a9a1586f30242590700000000]' -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • body: Array<string>

      A list of IDs of the groups to be updated.

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

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

          Returns any

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

    Returns superagent.SuperAgentRequest

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

createApiKey

  • createApiKey(body: ApiKeyInfoReq, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Create a new API key. An endpoint for creating a new API key. Example usage: `curl -X POST https://api.us-east-1.mbedcloud.com/v3/api-keys -d '{&quot;name&quot;: &quot;MyKey1&quot;}' -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • body: ApiKeyInfoReq

      The details of the API key to be created.

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

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

          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

deleteApiKey

  • deleteApiKey(apiKey: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Delete API key. An endpoint for deleting the API key. Example usage: `curl -X DELETE https://api.us-east-1.mbedcloud.com/v3/api-keys/{apikey-id} -H 'Authorization: Bearer API_KEY'`

    Parameters

    • apiKey: string

      The ID of the API key to be deleted.

    • 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

deleteCertificate

  • deleteCertificate(certId: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Delete a trusted certificate by ID. An endpoint for deleting a trusted certificate. Example usage: `curl -X DELETE https://api.us-east-1.mbedcloud.com/v3/trusted-certificates/{cert-id} -H 'Authorization: Bearer API_KEY'`

    Parameters

    • certId: string

      The ID of the trusted certificate to be deleted.

    • 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

getAllApiKeys

  • getAllApiKeys(limit?: number, after?: string, order?: string, include?: string, keyEq?: string, ownerEq?: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get all API keys An endpoint for retrieving API keys in an array, optionally filtered by the owner. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/api-keys -H 'Authorization: Bearer API_KEY'`

    Parameters

    • Optional limit: number

      The number of results to return (2-1000), default is 50.

    • Optional after: string

      The entity ID to fetch after the given one.

    • Optional order: string

      The order of the records based on creation time, ASC or DESC; by default ASC

    • Optional include: string

      Comma separated additional data to return. Currently supported: total_count

    • Optional keyEq: string

      API key filter.

    • Optional ownerEq: string

      Owner name filter.

    • Optional callback: function
        • Parameters

          Returns any

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

    Returns superagent.SuperAgentRequest

getAllCertificates

  • getAllCertificates(limit?: number, after?: string, order?: string, include?: string, nameEq?: string, serviceEq?: string, expireEq?: number, deviceExecutionModeEq?: number, deviceExecutionModeNeq?: number, ownerEq?: string, enrollmentModeEq?: boolean, issuerLike?: string, subjectLike?: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get all trusted certificates. An endpoint for retrieving trusted certificates in an array. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/trusted-certificates -H 'Authorization: Bearer API_KEY'`

    Parameters

    • Optional limit: number

      The number of results to return (2-1000), default is 50.

    • Optional after: string

      The entity ID to fetch after the given one.

    • Optional order: string

      The order of the records based on creation time, ASC or DESC; by default ASC

    • Optional include: string

      Comma separated additional data to return. Currently supported: total_count

    • Optional nameEq: string

      Filter for certificate name

    • Optional serviceEq: string

      Service filter, either lwm2m or bootstrap

    • Optional expireEq: number

      Expire filter in days

    • Optional deviceExecutionModeEq: number

      Device execution mode, as 1 for developer certificates or as another natural integer value

    • Optional deviceExecutionModeNeq: number

      Device execution mode not equals filter

    • Optional ownerEq: string

      Owner name filter

    • Optional enrollmentModeEq: boolean

      Enrollment mode filter

    • Optional issuerLike: string

      Issuer filter. Finds all matches where the filter value is a case insensitive substring of the result. Example: issuer__like=cn=iss matches CN=issuer.

    • Optional subjectLike: string

      Subject filter. Finds all matches where the filter value is a case insensitive substring of the result. Example: subject__like=cn=su matches CN=subject.

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

    Returns superagent.SuperAgentRequest

getAllGroups

  • getAllGroups(limit?: number, after?: string, order?: string, include?: string, nameEq?: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get all group information. An endpoint for retrieving all group information. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/policy-groups -H 'Authorization: Bearer API_KEY'`

    Parameters

    • Optional limit: number

      The number of results to return (2-1000), default is 50.

    • Optional after: string

      The entity ID to fetch after the given one.

    • Optional order: string

      The order of the records based on creation time, ASC or DESC; by default ASC

    • Optional include: string

      Comma separated additional data to return. Currently supported: total_count

    • Optional nameEq: string

      Filter for group name

    • Optional callback: function
        • Parameters

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

          Returns any

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

    Returns superagent.SuperAgentRequest

getApiKey

  • getApiKey(apiKey: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get API key details. An endpoint for retrieving API key details. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/api-keys/{apikey-id} -H 'Authorization: Bearer API_KEY'`

    Parameters

    • apiKey: string

      The ID of the API key to be retrieved.

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

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

          Returns any

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

    Returns superagent.SuperAgentRequest

getApiKeysOfGroup

  • getApiKeysOfGroup(groupID: string, limit?: number, after?: string, order?: string, include?: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get the API keys of a group. An endpoint for listing the API keys of the group with details. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/policy-groups/{group-id}/api-keys -H 'Authorization: Bearer API_KEY'`

    Parameters

    • groupID: string

      The ID of the group whose API keys are retrieved.

    • Optional limit: number

      The number of results to return (2-1000), default is 50.

    • Optional after: string

      The entity ID to fetch after the given one.

    • Optional order: string

      The order of the records based on creation time, ASC or DESC; by default ASC

    • Optional include: string

      Comma separated additional data to return. Currently supported: total_count

    • Optional callback: function
        • Parameters

          Returns any

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

    Returns superagent.SuperAgentRequest

getCertificate

  • getCertificate(certId: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get trusted certificate by ID. An endpoint for retrieving a trusted certificate by ID. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/trusted-certificates/{cert-id} -H 'Authorization: Bearer API_KEY'`

    Parameters

    • certId: string

      The ID of the trusted certificate to be retrieved.

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

    Returns superagent.SuperAgentRequest

getGroupSummary

  • getGroupSummary(groupID: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get group information. An endpoint for getting general information about the group. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/policy-groups/{group-id} -H 'Authorization: Bearer API_KEY'`

    Parameters

    • groupID: string

      The ID of the group to be retrieved.

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

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

          Returns any

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

    Returns superagent.SuperAgentRequest

getGroupsOfMyApiKey

  • getGroupsOfMyApiKey(limit?: number, after?: string, order?: string, include?: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get groups of the API key. An endpoint for retrieving groups of the API key. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/api-keys/me/groups -H 'Authorization: Bearer API_KEY'`

    Parameters

    • Optional limit: number

      The number of results to return (2-1000), default is 50.

    • Optional after: string

      The entity ID to fetch after the given one.

    • Optional order: string

      The order of the records based on creation time, ASC or DESC; by default ASC

    • Optional include: string

      Comma separated additional data to return. Currently supported: total_count

    • Optional callback: function
        • Parameters

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

          Returns any

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

    Returns superagent.SuperAgentRequest

getMyAccountInfo

  • getMyAccountInfo(include?: string, properties?: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get account info. Returns detailed information about the account. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/accounts/me?include=policies -H 'Authorization: Bearer API_KEY'`.

    Parameters

    • Optional include: string

      Comma separated additional data to return. Currently supported: limits, policies, sub_accounts.

    • Optional properties: string

      Property name to be returned from account specific properties.

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

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

          Returns any

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

    Returns superagent.SuperAgentRequest

getMyApiKey

  • getMyApiKey(callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get API key details. An endpoint for retrieving API key details. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/api-keys/me -H 'Authorization: Bearer API_KEY'`

    Parameters

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

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

          Returns any

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

    Returns superagent.SuperAgentRequest

removeApiKeysFromGroup

  • removeApiKeysFromGroup(groupID: string, body: SubjectList, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Remove API keys from a group. An endpoint for removing API keys from groups. Example usage: `curl -X DELETE https://api.us-east-1.mbedcloud.com/v3/policy-groups/{group-id}/api-keys -d '[0162056a9a1586f30242590700000000,0117056a9a1586f30242590700000000]' -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • groupID: string

      The ID of the group whose API keys are removed.

    • body: SubjectList

      A list of API keys to be removed from the group.

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

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

          Returns any

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

    Returns superagent.SuperAgentRequest

removeMyApiKeyFromGroups

  • removeMyApiKeyFromGroups(body: Array<string>, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Remove API key from groups. An endpoint for removing API key from groups. Example usage: `curl -X DELETE https://api.us-east-1.mbedcloud.com/v3/api-keys/me/groups -d '[0162056a9a1586f30242590700000000,0117056a9a1586f30242590700000000]' -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • body: Array<string>

      A list of IDs of the groups to be updated.

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

          • error: any
          • Optional data: UpdatedResponse
          • 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

updateApiKey

  • updateApiKey(apiKey: string, body: ApiKeyUpdateReq, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Update API key details. An endpoint for updating API key details. Example usage: `curl -X PUT https://api.us-east-1.mbedcloud.com/v3/api-keys/{apikey-id} -d '{&quot;name&quot;: &quot;TestApiKey25&quot;}' -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • apiKey: string

      The ID of the API key to be updated.

    • body: ApiKeyUpdateReq

      New API key attributes to be stored.

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

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

          Returns any

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

    Returns superagent.SuperAgentRequest

updateCertificate

  • updateCertificate(certId: string, body: TrustedCertificateUpdateReq, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Update trusted certificate. An endpoint for updating existing trusted certificates. Example usage: `curl -X PUT https://api.us-east-1.mbedcloud.com/v3/trusted-certificates/{cert-id} -d {&quot;description&quot;: &quot;very important cert&quot;} -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • certId: string

      The ID of the trusted certificate to be updated.

    • body: TrustedCertificateUpdateReq

      A trusted certificate object with attributes.

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

    Returns superagent.SuperAgentRequest

updateMyApiKey

  • updateMyApiKey(body: ApiKeyUpdateReq, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Update API key details. An endpoint for updating API key details. Example usage: `curl -X PUT https://api.us-east-1.mbedcloud.com/v3/api-keys/me -d '{&quot;name&quot;: &quot;TestApiKey25&quot;}' -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • body: ApiKeyUpdateReq

      New API key attributes to be stored.

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

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

          Returns any

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

    Returns superagent.SuperAgentRequest