@envoy/envoy-integrations-sdk / EnvoyUserAPI
API endpoints for user-scoped tokens. To access Envoy resources, this is the API you'd want.
-
EnvoyAPI↳ EnvoyUserAPI
- createInvite
- getAgreement
- getAgreementPage
- getCompany
- getEmployee
- getEmployeeByEmail
- getEmployees
- getFlow
- getFlows
- getInvites
- getLocation
- getLocations
- getSignInField
- getSignInFieldPage
- getSignInFields
- me
- partialUpdateInvite
- removeInvite
- updateInvite
- getAuthorizeURL
- loginAsPluginInstaller
- loginAsUserWithCode
- loginAsUserWithPassword
• new EnvoyUserAPI(accessToken)
| Name | Type |
|---|---|
accessToken |
string |
EnvoyAPI.constructor
• Readonly axios: AxiosInstance
HTTP Client with Envoy's defaults.
EnvoyAPI.axios
▸ createInvite(invite): Promise<InviteModel>
Requires invites.write scope.
May also require invites.attest scope if setting attested: true.
| Name | Type |
|---|---|
invite |
InviteCreationModel |
Promise<InviteModel>
▸ getAgreement(id, include?): Promise<AgreementModel>
Requires agreements.read scope.
| Name | Type |
|---|---|
id |
string |
include? |
string |
Promise<AgreementModel>
▸ getAgreementPage(id, include?): Promise<AgreementPageModel>
| Name | Type |
|---|---|
id |
string |
include? |
string |
Promise<AgreementPageModel>
▸ getCompany(id, include?): Promise<CompanyModel>
Requires companies.read scope.
| Name | Type |
|---|---|
id |
string |
include? |
string |
Promise<CompanyModel>
▸ getEmployee(id, include?): Promise<EmployeeModel>
Requires employees.read scope.
| Name | Type |
|---|---|
id |
string |
include? |
string |
Promise<EmployeeModel>
▸ getEmployeeByEmail(email, include?): Promise<EmployeeModel>
Requires employees.read scope.
| Name | Type |
|---|---|
email |
string |
include? |
string |
Promise<EmployeeModel>
▸ getEmployees(params?): Promise<EmployeeModel[]>
Requires employees.read scope.
| Name | Type |
|---|---|
params? |
default<EmployeeFilterFields, EmployeeSortFields> |
Promise<EmployeeModel[]>
▸ getFlow(id, include?): Promise<FlowModel>
Requires flows.read scope.
| Name | Type |
|---|---|
id |
string |
include? |
string |
Promise<FlowModel>
▸ getFlows(params?): Promise<FlowModel[]>
Requires flows.read scope.
| Name | Type |
|---|---|
params? |
default<FlowFilterFields, FlowSortFields> |
Promise<FlowModel[]>
▸ getInvites(params?): Promise<InviteModel[]>
Requires invites.read scope.
| Name | Type |
|---|---|
params? |
default<InviteFilterFields, InviteSortFields> |
Promise<InviteModel[]>
▸ getLocation(id, include?): Promise<LocationModel>
Requires locations.read scope.
| Name | Type |
|---|---|
id |
string |
include? |
string |
Promise<LocationModel>
▸ getLocations(params?): Promise<LocationModel[]>
Requires locations.read scope.
| Name | Type |
|---|---|
params? |
default<LocationFilterFields, LocationSortFields> |
Promise<LocationModel[]>
▸ getSignInField(id, include?): Promise<SignInFieldModel>
Requires sign-in-fields.read scope.
| Name | Type |
|---|---|
id |
string |
include? |
string |
Promise<SignInFieldModel>
▸ getSignInFieldPage(id, include?): Promise<SignInFieldPageModel>
Requires sign-in-field-pages.read scope.
| Name | Type |
|---|---|
id |
string |
include? |
string |
Promise<SignInFieldPageModel>
▸ getSignInFields(signInFieldPageId): Promise<SignInFieldModel[]>
Requires sign-in-fields.read scope.
| Name | Type |
|---|---|
signInFieldPageId |
string |
Promise<SignInFieldModel[]>
▸ me(): Promise<UserModel>
Promise<UserModel>
▸ partialUpdateInvite(inviteId, invite): Promise<InviteModel>
Requires invites.write scope.
| Name | Type |
|---|---|
inviteId |
string |
invite |
InviteCreationModel |
Promise<InviteModel>
▸ removeInvite(inviteId): Promise<void>
Requires invites.write scope.
| Name | Type |
|---|---|
inviteId |
string |
Promise<void>
▸ updateInvite(inviteId, invite): Promise<InviteModel>
Requires invites.write scope.
| Name | Type |
|---|---|
inviteId |
string |
invite |
InviteCreationModel |
Promise<InviteModel>
▸ Static getAuthorizeURL(redirectURL, scope, clientId?): string
Builds the authorize URL to redirect a user to initiate the auth code oauth2 flow.
Upon completion, they will be redirected to redirectURL, with a code query param in the url.
Use the loginAsUserWithCode method to exchange that code for an access token.
| Name | Type |
|---|---|
redirectURL |
string |
scope |
string[] |
clientId |
string |
string
▸ Static loginAsPluginInstaller(installId, clientId?, clientSecret?): Promise<EnvoyMetaAuth>
Gets a user access token using plugin_install as the grant type.
| Name | Type |
|---|---|
installId |
string |
clientId |
string |
clientSecret |
string |
Promise<EnvoyMetaAuth>
▸ Static loginAsUserWithCode(code, scope, clientId?, clientSecret?): Promise<EnvoyMetaAuth>
Gets a user access token using code as the grant type.
| Name | Type |
|---|---|
code |
string |
scope |
string[] |
clientId |
string |
clientSecret |
string |
Promise<EnvoyMetaAuth>
▸ Static loginAsUserWithPassword(username, password, scope, clientId?, clientSecret?): Promise<EnvoyMetaAuth>
Gets a user access token using password as the grant type (discouraged - use loginAsUserWithCode below).
| Name | Type |
|---|---|
username |
string |
password |
string |
scope |
string[] |
clientId |
string |
clientSecret |
string |
Promise<EnvoyMetaAuth>