3.0.0 • Published 5 years ago
@datafire/nexmo_external_accounts v3.0.0
@datafire/nexmo_external_accounts
Client library for External Accounts API
Installation and Usage
npm install --save @datafire/nexmo_external_accounts
let nexmo_external_accounts = require('@datafire/nexmo_external_accounts').create({
username: "",
password: "",
bearerAuth: ""
});
.then(data => {
console.log(data);
});
Description
The External Accounts API is used to manage accounts for Viber Service Messages, Facebook Messenger and Whatsapp for use in the Messages and Dispatch APIs.
Actions
GetAllAccounts
Retrieve all accounts you own
nexmo_external_accounts.GetAllAccounts({}, context)
Input
- input
object
- provider
string
(values: messenger, viber_service_msg, whatsapp): Filter by provider - page_number
integer
: Page number of the results - page_size
integer
: Page size of the results
- provider
Output
- output
object
- _embedded
array
- items GetAllAccountResponse
- _links
object
- first
object
- href
string
- href
- last
object
- href
string
- href
- next
object
- href
string
- href
- prev
object
- href
string
- href
- self
object
- href
string
- href
- first
- page_number
integer
- page_size
integer
- _embedded
CreateMessengerAccount
Create a Messenger account
nexmo_external_accounts.CreateMessengerAccount({
"body": {
"external_id": "",
"access_token": ""
}
}, context)
Input
- input
object
- body required
object
- access_token required
string
: This is the Facebook Page token. You can obtain the token using one of the following methods Use our tool to link a page to your Vonage API account https://messenger.nexmo.com Following the official token reference - applications
array
: Contains a list of application IDs which are linked to the account. There is just one application allowed per an account. The application type must be type "messages". For more information see Application API spec- items
string
- items
- external_id required
string
: This is the unique identifier within the provider's domain. In this case it is the Page ID for your Facebook Page. Go to your Facebook Page, click "Settings", click "Messenger platform " scroll down to "Messenger link" to find your Page ID. - name
string
: Custom account name
- access_token required
- body required
Output
- output MessengerAccountResponse
DeleteMessengerAccount
Delete a Messenger account
nexmo_external_accounts.DeleteMessengerAccount({
"external_id": ""
}, context)
Input
- input
object
- external_id required
string
: External id of the account you want to delete. In this case it is the Facebook Page ID.
- external_id required
Output
Output schema unknown
GetMessengerAccount
Retrieve a Messenger account
nexmo_external_accounts.GetMessengerAccount({
"external_id": ""
}, context)
Input
- input
object
- external_id required
string
: External id of the account you want to retrieve. In this case it is the Facebook Page ID.
- external_id required
Output
- output MessengerAccountResponse
UpdateMessengerAccount
Update a Messenger account
nexmo_external_accounts.UpdateMessengerAccount({
"external_id": "",
"body": {}
}, context)
Input
- input
object
- external_id required
string
: External id of the account you want to update. In this case it is the Facebook Page ID. - body required
object
- access_token
string
- applications
array
- items
string
- items
- name
string
: The new account name
- access_token
- external_id required
Output
- output
object
- access_token required
string
: The provider access token - api_key required
string
: The external api key for this account - applications
array
: The array of associated application ids- items
string
- items
- external_id required
string
: The external identifier for this account. In this case it is the Facebook Page ID. - name
string
: The account name - provider required
string
: The provider (will bemessenger
).
- access_token required
GetVSMAccount
Retrieve a Viber Service Message account
nexmo_external_accounts.GetVSMAccount({
"external_id": ""
}, context)
Input
- input
object
- external_id required
string
: External id of the account you want to retrieve. In this case it will be your Viber Service Message ID.
- external_id required
Output
- output VSMAccountResponse
GetWAAccount
Retrieve a Whatsapp account
nexmo_external_accounts.GetWAAccount({
"external_id": ""
}, context)
Input
- input
object
- external_id required
string
: External id of the account you want to retrieve. In this case it will be the WhatsApp number.
- external_id required
Output
- output WAAccountResponse
LinkApplication
Link application to an account
nexmo_external_accounts.LinkApplication({
"provider": "",
"external_id": "",
"body": {
"application": ""
}
}, context)
Input
- input
object
- provider required
string
(values: messenger, viber_service_msg, whatsapp): Provider of the account you want to assign an application to - external_id required
string
: External id of the account you want to assign an application to. This is channel dependent. For Facebook it will be your Facebook Page ID, for Viber your Viber Service Message ID and for WhatsApp your WhatsApp number. - body required
object
- application required
string
: There is just one application allowed per an account. The application type must be type "messages". For more information please see Application API Spec
- application required
- provider required
Output
- output AccountResponse
UnliWithoutApplicationnkApplication
Unlink application from an account
nexmo_external_accounts.UnliWithoutApplicationnkApplication({
"provider": "",
"external_id": "",
"application_id": ""
}, context)
Input
- input
object
- provider required
string
(values: messenger, viber_service_msg, whatsapp): Provider of the account you want to unlink an application from - external_id required
string
: External id of the account you want to unlink an application from - application_id required
string
: Id of the application you want to unlink
- provider required
Output
Output schema unknown
Definitions
401Response
- 401Response
object
- detail
string
- title
string
- detail
403Response
- 403Response
object
- title
string
- title
AccountResponse
- AccountResponse
object
- access_token
string
: The provider access token (only formessenger
) - api_key required
string
: The external api key for this account - applications
array
: The array of associated application ids- items
string
- items
- external_id required
string
: The external identifier for this account - name
string
: The account name - provider required
string
(values: messenger, viber_service_msg, whatsapp): The provider (will be one ofmessenger, viber_service_msg, whatsapp
).
- access_token
GetAllAccountResponse
- GetAllAccountResponse
- access_token required
string
: The provider access token - api_key required
string
: The external api key for this account - applications
array
: The array of associated application ids- items
string
- items
- external_id required
string
: The external identifier for this account - name
string
: The account name - provider required
string
: The provider (will bemessenger
). - api_key required
string
: The external api key for this account - applications
array
: The array of associated application ids- items
string
- items
- external_id required
string
: The external identifier for this account - name
string
: The account name - provider required
string
: The provider (will beviber_service_msg
). - api_key required
string
: The external api key for this account - applications
array
: The array of associated application ids- items
string
- items
- external_id required
string
: The external identifier for this account - name
string
: The account name - provider required
string
: The provider (will bewhatsapp
).
- access_token required
MessengerAccountResponse
- MessengerAccountResponse
object
- access_token required
string
: The provider access token - api_key required
string
: The external api key for this account - applications
array
: The array of associated application ids- items
string
- items
- external_id required
string
: The external identifier for this account - name
string
: The account name - provider required
string
: The provider (will bemessenger
).
- access_token required
VSMAccountResponse
- VSMAccountResponse
object
- api_key required
string
: The external api key for this account - applications
array
: The array of associated application ids- items
string
- items
- external_id required
string
: The external identifier for this account - name
string
: The account name - provider required
string
: The provider (will beviber_service_msg
).
- api_key required
WAAccountResponse
- WAAccountResponse
object
- api_key required
string
: The external api key for this account - applications
array
: The array of associated application ids- items
string
- items
- external_id required
string
: The external identifier for this account - name
string
: The account name - provider required
string
: The provider (will bewhatsapp
).
- api_key required
3.0.0
5 years ago