Invites
Invites are invitations by an account holder (the inviter) to another user (the invitee) to share their account. An optional role
property may determine how the invitee can access the account.
A user who wishes to share an account creates an invite object. The invite contains a linklink
, a short encrypted string that can be used to represent the invite. The inviter sends the linklink as a text message to the invitee.
An invitee must claim an account before he/she can use it. When this occurs the invite becomes invalid, and an objectLink
is created to represent the sharing connection.
Invite Object
An invite is represented as a JSON object. This table specifies the properties that may be included in this object:
Property | Type | Required? (default) | Description |
---|---|---|---|
AFiInviteId | string | yes | AmpliFi Id of the invite |
AFiUserId | string | yes | AmpliFi Id of the user (inviter) |
AFiAccountId | string | yes | AmpliFi Id of the account to be shared |
AFiCardId | string | no (none) | AmpliFi Id of the card to be shared, if any |
role | string | yes | role for invitee when accessing the account |
familyMemberType | string | no (none) | family member type, if any |
linklink | string | yes | link that represents the invite |
isActive | boolean | yes | true if the invite is currently active |
dtsCreated | dts | yes | date/time the invite was created |
dtsExpiry | dts | yes | date/time the invite will expire |
ObjectLink Object
An objectLink is a JSON object representing an invite that has been claimed by the invitee. This links the owner of the account to the user who is sharing it. This table specifies the properties that may be included in this object:
Property | Type | Required? (default) | Description |
---|---|---|---|
AFiObjectLinkId | string | yes | AmpliFi Id of the invite |
AFiInviteId | string | yes | AmpliFi Id of the invite |
inviterAFiUserId | string | yes | User Id for the inviter |
inviteeAFiUserId | string | yes | User Id for the invitee |
AFiAccountId | string | yes | Id of the account being shared |
AFiCardId | string | no (none) | Id of the card being shared, if any |
inviteeName | object | no (none) | firstName, middleName, and lastName of the invitee |
isActive | boolean | yes | true if the objectLink is currently active |
dtsCreated | dts | yes | date/time when the invite was created |
dtsUsed | dts | yes | date/time when the invite was used (claimed) |
Create New Invite
POST /invite/new/
This API is used by an account holder to share his/her own account with another user. The response contains an invite object that can be shared with another user, enabling that user to access the account.
The optional role
property specifies the role the invited user will have for this account. The optional firstName
and lastName
properties give the name of the invitee.
Request body:
{
"AFiAccountId": "qwegal4oadm9rxrxh", // Id of the account to be shared (required)
"AFiCardId": "qwegal4oadm9rxrxh", // Id of the card to be shared (optional)
"role": "test", // role for the invitee (optional)
"firstName": "Test", // first name of the invitee (optional)
"lastName": "Test2" // last name of the invitee (optional)
}
Response body:
List Invites and ObjectLinks
POST /invites/all
List all invites and objectLinks for the current user
Response body:
{
"success": true,
"invites": [ // array of invite objects
],
"objectLinks": [ // array of objectLink objects
]
}
List Invites for a Specific Account
GET /invites/foraccount/:AFiAccountId
Get account invites sent for a specific account. The account is identified by a path parameter.
Response body:
Claim an Invite
PUT /invite/claim/:linklink
This API is called by a user who has received an invite to claim access to the account he/she has been invited to. The invite is represented by the path parameter linklink
. This is a property of the invite object.
If the claim is successful, the user is given access to the account for the role specified and the invite object is replaced by an objectLink object.
Response body: