Documentation

Mistake on this page? Email us

AccountAdminApi

Hierarchy

  • ApiBase
    • AccountAdminApi

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 AccountAdminApi

Methods

addApiKeyToGroups

  • addApiKeyToGroups(apiKey: string, 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/{apikey-id}/groups -d '[0162056a9a1586f30242590700000000,0117056a9a1586f30242590700000000]' -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • apiKey: string

      The ID of the API key to be added to the group.

    • 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

addCertificate

  • addCertificate(body: TrustedCertificateReq, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Upload a new trusted certificate. An endpoint for uploading new trusted certificates. Example usage: `curl -X POST https://api.us-east-1.mbedcloud.com/v3/trusted-certificates -d {"name": "myCert1", "description": "very important cert", "certificate": "certificate_data", "service": "lwm2m"} -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • body: TrustedCertificateReq

      A trusted certificate object with attributes.

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

    Returns superagent.SuperAgentRequest

addSubjectsToGroup

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

    Parameters

    • groupID: string

      The ID of the group to be updated.

    • body: SubjectList

      A list of users and API keys to be added to 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

addUserToGroups

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

    Parameters

    • userId: string

      The ID of the user to be added to the group.

    • 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

createGroup

  • createGroup(body: GroupCreationInfo, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Create a new group. An endpoint for creating a new group. Example usage: `curl -X POST https://api.us-east-1.mbedcloud.com/v3/policy-groups -d '{"name": "MyGroup1"}' -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • body: GroupCreationInfo

      Details of the group to be created.

    • 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

createUser

  • createUser(body: UserInfoReq, action?: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Create a new user. An endpoint for creating or inviting a new user to the account. In case of invitation email address is used only, other attributes are set in the 2nd step. Example usage: `curl -X POST https://api.us-east-1.mbedcloud.com/v3/users?action=invite -d {"email": "myemail@company.com"} -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • body: UserInfoReq

      A user object with attributes.

    • Optional action: string

      Action, either 'create' or 'invite'.

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

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

deleteGroup

  • deleteGroup(groupID: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Delete a group. An endpoint for deleting a group. Example usage: `curl -X DELETE 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 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

deleteUser

  • deleteUser(userId: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Delete a user. An endpoint for deleting a user. Example usage: `curl -X DELETE https://api.us-east-1.mbedcloud.com/v3/users/{user-id} -H 'Authorization: Bearer API_KEY'`

    Parameters

    • userId: string

      The ID of the user 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

getAllUsers

  • getAllUsers(limit?: number, after?: string, order?: string, include?: string, emailEq?: string, statusEq?: string, statusIn?: string, statusNin?: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get the details of all users. An endpoint for retrieving the details of all users. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/users -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 emailEq: string

      Filter for email address

    • Optional statusEq: string

      Filter for status, for example active or reset

    • Optional statusIn: string

      An optional filter for getting users with a specified set of statuses.

    • Optional statusNin: string

      An optional filter for excluding users with a specified set of statuses.

    • Optional callback: function
        • Parameters

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

          Returns any

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

    Returns superagent.SuperAgentRequest

getGroupsOfApikey

  • getGroupsOfApikey(apiKey: string, 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/{apikey-id}/groups -H 'Authorization: Bearer API_KEY'`

    Parameters

    • apiKey: string

      The ID of the API key whose details 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

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

          Returns any

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

    Returns superagent.SuperAgentRequest

getGroupsOfUser

  • getGroupsOfUser(userId: string, limit?: number, after?: string, order?: string, include?: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Get groups of the user. An endpoint for retrieving groups of the user. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/users/{user-id}/groups -H 'Authorization: Bearer API_KEY'`

    Parameters

    • userId: string

      The ID of the user whose details 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

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

          Returns any

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

    Returns superagent.SuperAgentRequest

getUser

  • getUser(userId: string, properties?: string, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Details of a user. An endpoint for retrieving the details of a user. Example usage: `curl https://api.us-east-1.mbedcloud.com/v3/users/{user-id} -H 'Authorization: Bearer API_KEY'`

    Parameters

    • userId: string

      The ID of the user whose details are retrieved.

    • Optional properties: string

      Request to return account specific user property values according to the given property name.

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

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

          Returns any

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

    Returns superagent.SuperAgentRequest

getUsersOfGroup

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

    Parameters

    • groupID: string

      The ID of the group whose users 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 statusEq: string

      An optional filter for getting users by status.

    • Optional statusIn: string

      An optional filter for getting users with a specified set of statuses.

    • Optional statusNin: string

      An optional filter for excluding users with a specified set of statuses.

    • Optional callback: function
        • Parameters

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

          Returns any

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

    Returns superagent.SuperAgentRequest

removeApiKeyFromGroups

  • removeApiKeyFromGroups(apiKey: string, 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/{apikey-id}/groups -d '[0162056a9a1586f30242590700000000,0117056a9a1586f30242590700000000]' -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • apiKey: string

      The ID of the API key to be removed from the group.

    • 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

removeUserFromGroups

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

    Parameters

    • userId: string

      The ID of the user to be removed from the group.

    • 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

removeUsersFromGroup

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

    Parameters

    • groupID: string

      The ID of the group whose users are removed.

    • body: SubjectList

      A list of users 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

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

updateGroupName

  • updateGroupName(groupID: string, body: GroupUpdateInfo, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Update the group name. An endpoint for updating a group name. Example usage: `curl -X PUT https://api.us-east-1.mbedcloud.com/v3/policy-groups/{group-id} -d '{"name": "TestGroup2"}' -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • groupID: string

      The ID of the group to be updated.

    • body: GroupUpdateInfo

      Details of the group to be created.

    • 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

updateMyAccount

  • updateMyAccount(body: AccountUpdateReq, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Updates attributes of the account. An endpoint for updating the account. Example usage: `curl -X PUT https://api.us-east-1.mbedcloud.com/v3/accounts/me -d '{"phone_number": "12345678"}' -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • body: AccountUpdateReq

      Details of the account to be updated.

    • 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

updateUser

  • updateUser(userId: string, body: UserUpdateReq, callback?: function, requestOptions?: object): superagent.SuperAgentRequest
  • Update user details. An endpoint for updating user details. Example usage: `curl -X PUT https://api.us-east-1.mbedcloud.com/v3/users/{user-id} -d '{"username": "myusername"}' -H 'content-type: application/json' -H 'Authorization: Bearer API_KEY'`

    Parameters

    • userId: string

      The ID of the user whose details are updated.

    • body: UserUpdateReq

      A user object with attributes.

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

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

          Returns any

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

    Returns superagent.SuperAgentRequest