Skip to content

Latest commit

 

History

History

nexmo_conversation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

@datafire/nexmo_conversation

Client library for Conversation API

Installation and Usage

npm install --save @datafire/nexmo_conversation
let nexmo_conversation = require('@datafire/nexmo_conversation').create({
  bearerAuth: ""
});

.then(data => {
  console.log(data);
});

Description

The Conversation API enables you to build conversation features where communication can take place across multiple mediums including IP Messaging, PSTN Voice, SMS and WebRTC Audio and Video. The context of the conversations is maintained though each communication event taking place within a conversation, no matter the medium.

Actions

listConversations

This API endpoint is deprecated. Please use /v0.2/conversations.
This endpoint will return a maximum of 100 items.

List all conversations associated with your application. This endpoint required an admin JWT. To find all conversations for the currently logged in user, see [GET /users/:id/conversations](#getuserConversations)
nexmo_conversation.listConversations({}, context)

Input

  • input object
    • date_start string: Return the records that occurred after this point in time.
    • date_end string: Return the records that occurred before this point in time.
    • page_size number: Return this amount of records in the response
    • record_index number: Return calls from this index in the response
    • order string (values: asc, desc, ASC, DESC): Return the records in ascending or descending order.

Output

createConversation

Create a conversation

nexmo_conversation.createConversation({}, context)

Input

Output

deleteConversation

Delete a conversation

nexmo_conversation.deleteConversation({
  "conversation_id": ""
}, context)

Input

  • input object
    • conversation_id required string: Conversation ID

Output

  • output object: Empty JSON payload

retrieveConversation

Retrieve a conversation

nexmo_conversation.retrieveConversation({
  "conversation_id": ""
}, context)

Input

  • input object
    • conversation_id required string: Conversation ID

Output

replaceConversation

Update a conversation

nexmo_conversation.replaceConversation({
  "conversation_id": ""
}, context)

Input

Output

getEvents

This API endpoint is deprecated. Please use /v0.2/events
This endpoint will return a maximum of 100 items.

nexmo_conversation.getEvents({
  "conversation_id": ""
}, context)

Input

  • input object
    • conversation_id required string: Conversation ID

Output

createEvent

Create an event

nexmo_conversation.createEvent({
  "conversation_id": ""
}, context)

Input

  • input object

Output

deleteEvent

Delete an event

nexmo_conversation.deleteEvent({
  "conversation_id": "",
  "event_id": ""
}, context)

Input

  • input object
    • conversation_id required string: Conversation ID
    • event_id required string: Event ID

Output

  • output object: Empty JSON payload

getEvent

Retrieve an event

nexmo_conversation.getEvent({
  "conversation_id": "",
  "event_id": ""
}, context)

Input

  • input object
    • conversation_id required string: Conversation ID
    • event_id required string: Event ID

Output

getMembers

This API endpoint is deprecated. Please use /v0.2/members
This endpoint will return a maximum of 100 items.

nexmo_conversation.getMembers({
  "conversation_id": ""
}, context)

Input

  • input object
    • conversation_id required string: Conversation ID

Output

createMember

Create a member

nexmo_conversation.createMember({
  "conversation_id": ""
}, context)

Input

Output

deleteMember

Delete a member

nexmo_conversation.deleteMember({
  "conversation_id": "",
  "member_id": ""
}, context)

Input

  • input object
    • conversation_id required string: Conversation ID
    • member_id required string: Member ID

Output

  • output object: Empty JSON payload

getMember

Retrieve a member

nexmo_conversation.getMember({
  "conversation_id": "",
  "member_id": ""
}, context)

Input

  • input object
    • conversation_id required string: Conversation ID
    • member_id required string: Member ID

Output

updateMember

Update a member

nexmo_conversation.updateMember({
  "conversation_id": "",
  "member_id": ""
}, context)

Input

  • input object
    • body object
    • conversation_id required string: Conversation ID
    • member_id required string: Member ID

Output

recordConversation

Record a conversation

nexmo_conversation.recordConversation({
  "conversation_id": ""
}, context)

Input

Output

Output schema unknown

listLegs

List legs

nexmo_conversation.listLegs(null, context)

Input

This action has no parameters

Output

deleteLeg

Delete a leg

nexmo_conversation.deleteLeg({
  "leg_id": ""
}, context)

Input

  • input object
    • leg_id required string: Leg ID

Output

  • output object: Empty JSON payload

getUsers

This API endpoint is deprecated. Please use /v0.2/users
This endpoint will return a maximum of 100 items.
nexmo_conversation.getUsers(null, context)

Input

This action has no parameters

Output

createUser

Note: Users must be created with an admin JWT.

nexmo_conversation.createUser({}, context)

Input

Output

deleteUser

Delete a user

nexmo_conversation.deleteUser({
  "user_id": ""
}, context)

Input

  • input object
    • user_id required string: User ID

Output

  • output object: Empty JSON payload

getUser

Retrieve a user

nexmo_conversation.getUser({
  "user_id": ""
}, context)

Input

  • input object
    • user_id required string: User ID

Output

updateUser

Update a user

nexmo_conversation.updateUser({
  "user_id": ""
}, context)

Input

Output

getuserConversations

List user conversations

nexmo_conversation.getuserConversations({
  "user_id": ""
}, context)

Input

  • input object
    • user_id required string: User ID

Output

Definitions

_links_conversation

_links_conversations_list

action

  • action string (values: start, stop): Recording Action

channel

  • channel object: A user who joins a conversation as a member can have one channel per membership type. Channels can be app, phone, sip, websocket, or vbc
    • leg_id leg_id
    • leg_ids array: Leg ids associated with this Channel. The first item in the array represents the main active Leg. The second item, if exists, represents a screen-share Leg.
    • type channel_type

channel_number

  • channel_number string: this can be a phone number or a random string

channel_type

  • channel_type string (values: app, phone, sip, websocket, vbc): Channel type

conversation_id

  • conversation_id string: The unique identifier for this conversation

conversation_properties

  • conversation_properties object: Conversation properties
    • ttl number: Time to leave. After how many seconds an empty conversation is deleted.

display_name

  • display_name string: The display name for the conversation. It does not have to be unique

display_name_user

  • display_name_user string: A string to be displayed as user name. It does not need to be unique

event_body

  • event_body object: Event Body

event_id

  • event_id string: Event id. This is a progressive integer

event_method

  • event_method string: The HTTP method used to send event information to event_url.

event_retrieved

event_type

  • event_type string: Event type

event_url

  • event_url array: The webhook endpoint where recording progress events are sent to.
    • items string

format

  • format string (values: mp3, wav): Record the Conversation in a specific format.

href

  • href string: A link towards a resources included in Conversation API

href_conversation

  • href_conversation string: A link towards a conversation included in Conversation API

href_conversations_list

  • href_conversations_list string: A link towards a conversations list included in Conversation API

href_event

  • href_event string: A link towards a conversation event included in Conversation API

href_member

  • href_member string: A link towards a member included in Conversation API

href_rtc

  • href_rtc string: A link towards a rtc (leg) included in Conversation API

href_user

  • href_user string: A link towards a user included in Conversation API

image_url

  • image_url string: A link to an image for conversations' and users' avatars

initiator

  • initiator object
    • joined object
      • isSystem boolean: true if the user was invited by an admin JWT. user_id and member_id will not exist if true
      • member_id member_id
      • user_id user_id

knocker_id

  • knocker_id string: Knocker ID. A knocker is a pre-member of a conversation who does not exist yet

leg_id

  • leg_id string: The id of the leg. rtc_id and call_id are leg id

leg_state

  • leg_state string (values: terminated): Leg Status

media

  • media object: Media Object

member_action

  • member_action string (values: invite, join): Invite or join a member to a conversation

member_id

  • member_id string: Member ID

member_id_inviting

  • member_id_inviting string: Member ID of the member that sends the invitation

member_state

  • member_state string (values: invited, joined, left, unknown): The state that the member is in. Possible values are invited, joined, left, or unknown

name

  • name string: Unique name

name_conversation

  • name_conversation string: Unique name for a conversation

name_user

  • name_user string: Unique name for a user

page_size

  • page_size number: The amount of records returned in this response

record_index

  • record_index number: Return page_size amount of conversations from this index in the response. That is, if your request returns 300 conversations, set record_index to 5 in order to return conversations 50 to 59. The default value is 0. That is, the first page_size calls.

split

  • split string: Record the sent and received audio in separate channels of a stereo recording

timestamp

  • timestamp string: Timestamp

timestamp_created

  • timestamp_created string: Time of creation

timestamp_destroyed

  • timestamp_destroyed string: Time of last update

timestamp_leg_end_time

  • timestamp_leg_end_time string: Time of leg end

timestamp_leg_start_time

  • timestamp_leg_start_time string: Time of leg start

timestamp_obj_leg

timestamp_res_conversation

timestamp_res_event

  • timestamp_res_event string: Time of event creation

timestamp_res_member

timestamp_updated

  • timestamp_updated string: Time of last update

user_id

  • user_id string: User ID

user_id_or_user_name

  • user_id_or_user_name string: user name or user id of the inviter