ordercloud-javascript-sdk
    Preparing search index...

    Class AdminUsers

    Index
    • Returns this

      enables impersonation by calling the subsequent method with the stored impersonation token

      AdminUsers.As().List() // lists AdminUsers using the impersonated users' token
      
    • Create an admin user Check out the docs for more info

      Type Parameters

      • TUser extends User<any>

      Parameters

      • user: User

        Required fields: Username, FirstName, LastName, Email, Active

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TUser>>

    • Delete an admin user Check out the docs for more info

      Parameters

      • userID: string

        ID of the user.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<void>

    • Retrieve an admin user Check out the docs for more info

      Type Parameters

      • TUser extends User<any>

      Parameters

      • userID: string

        ID of the user.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TUser>>

    • List admin users Check out the docs for more info

      Type Parameters

      • TUser extends User<any>

      Parameters

      • listOptions: {
            filters?: Filters;
            page?: number;
            pageSize?: number;
            search?: string;
            searchOn?: ("ID" | "LastName" | "FirstName" | "Username" | "Email")[];
            sortBy?: (
                | "ID"
                | "LastName"
                | "FirstName"
                | "Username"
                | "Email"
                | "DateCreated"
                | "!ID"
                | "!DateCreated"
                | "!FirstName"
                | "!LastName"
                | "LastActive"
                | "PasswordLastSetDate"
                | "!Username"
                | "!Email"
                | "!LastActive"
                | "!PasswordLastSetDate"
            )[];
        } = {}
        • Optionalfilters?: Filters

          An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

        • Optionalpage?: number

          Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

        • OptionalpageSize?: number

          Number of results to return per page.

        • Optionalsearch?: string

          Word or phrase to search for.

        • OptionalsearchOn?: ("ID" | "LastName" | "FirstName" | "Username" | "Email")[]

          Comma-delimited list of fields to search on.

        • OptionalsortBy?: (
              | "ID"
              | "LastName"
              | "FirstName"
              | "Username"
              | "Email"
              | "DateCreated"
              | "!ID"
              | "!DateCreated"
              | "!FirstName"
              | "!LastName"
              | "LastActive"
              | "PasswordLastSetDate"
              | "!Username"
              | "!Email"
              | "!LastActive"
              | "!PasswordLastSetDate"
          )[]

          Comma-delimited list of fields to sort by.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredObjectDeep<ListPage<TUser>>>

    • Revoke a user tokens Revokes all security tokens of specified user. Check out the docs for more info

      Parameters

      • userID: string

        ID of the user.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<void>

    • Create or update an admin user If an object with the same ID already exists, it will be overwritten. Check out the docs for more info

      Type Parameters

      • TUser extends User<any>

      Parameters

      • userID: string

        ID of the user.

      • user: User

        Required fields: Username, FirstName, LastName, Email, Active

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TUser>>

    • Unlock a user account Check out the docs for more info

      Parameters

      • userID: string

        ID of the user.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<void>