@datafire/nexmo_reports

3.0.0 • Public • Published

@datafire/nexmo_reports

Client library for Reports API

Installation and Usage

npm install --save @datafire/nexmo_reports
let nexmo_reports = require('@datafire/nexmo_reports').create({
  username: "",
  password: ""
});

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

Description

The Reports API enables you to request a report of activity for your Vonage account.

Depending on your query pattern, you can choose from one of the two versions of the Reports API: asynchronous and synchronous. The asynchronous version is optimized for infrequent and large data queries (from several records to tens of millions). The synchronous version is optimized for frequent and periodic retrievals of small batches of data records (from one record to tens of thousand per query).

Only synchronous version supports retrival of data records by message/record ID.

Vonage recommends that you limit asynchronous queries to a maximum of 20 million records, by setting the start and end dates accordingly. On average, the asynchronous Reports API takes 5 - 10 minutes to generate 1 million records.

Actions

v2.reports.get

List reports created by the specified account based on filtered provided.

nexmo_reports.v2.reports.get({
  "account_id": "",
  "status": ""
}, context)

Input

  • input object
    • account_id required string: The account for which the list of reports will be queried.
    • status required string: A comma-separated list of report status values. Reports with any of the statuses specified are returned. The values in the comma-seperated list specified for status can be any of PENDING, PROCESSING, SUCCESS, ABORTED, FAILED, TRUNCATED.
    • date_from string: ISO-8601 extended time zone offset or ISO-8601 UTC zone offset formatted date from which the list of reports will be queried. Format yyyy-mm-ddThh:mm:ss[.sss]±hh:mm or yyyy-mm-ddThh:mm:ss[.sss]Z.
    • date_to string: ISO-8601 extended time zone offset or ISO-8601 UTC zone offset formatted date until which the list of reports will be queried. Format yyyy-mm-ddThh:mm:ss[.sss]±hh:mm or yyyy-mm-ddThh:mm:ss[.sss]Z.

Output

  • output object
    • items_count integer: The number of reports in the list.
    • reports array: The list of reports.
      • items object
    • self_link string: URI of this search.

v2.reports.post

Request a report on your account activity

nexmo_reports.v2.reports.post({}, context)

Input

  • input object

Output

Output schema unknown

v2.reports.records.get

Fetch usage data synchronously

nexmo_reports.v2.reports.records.get({
  "account_id": "",
  "product": ""
}, context)

Input

  • input object
    • account_id required string: The account for which the list of reports will be queried.
    • product required string (values: SMS, VOICE-CALL, WEBSOCKET-CALL, VERIFY-API, NUMBER-INSIGHT, MESSAGES, CONVERSATIONS, ASR): The product to return records for
    • direction string (values: inbound, outbound): Direction of the communication, either inbound (received by our services), or outbound (originated from our services). Required for products SMS and MESSAGES. Optional for VOICE-CALL. Invalid for CONVERSATIONS, NUMBER-INSIGHT, VERIFY-API.
    • id string: The UUID of the message or call to be searched for. You can specify a comma-separated list of UUIDs. If UUIDs are not found they are listed in the response in the ids_not_found field.
    • date_start string: ISO-8601 extended time zone offset or ISO-8601 UTC zone offset formatted date (format yyyy-mm-ddThh:mm:ss[.sss]±hh:mm or yyyy-mm-ddThh:mm:ss[.sss]Z) for when reports should begin.
    • date_end string: Must be no more than 24 hours later than date_start
    • include_message boolean (values: true, false): Include the message contents in the records. Only applicable for use with products SMS and MESSAGES, where it is optional.
    • type string (values: ip-voice, cs-custom-event): The event type to search for. Only used, and is required, when product is CONVERSATIONS.
    • status string (values: delivered, expired, failed, rejected, accepted, buffered, unknown, deleted): The SMS status to search for. Optional where product is SMS.

Output

Output schema unknown

v2.reports.report_id.delete

Cancel the execution of a pending or processing report.

nexmo_reports.v2.reports.report_id.delete({
  "report_id": ""
}, context)

Input

  • input object
    • report_id required string: UUID of the report

Output

Output schema unknown

v2.reports.report_id.get

Retrieve status and metadata about a requested report.

nexmo_reports.v2.reports.report_id.get({
  "report_id": ""
}, context)

Input

  • input object
    • report_id required string: UUID of the report request (request_id in response).

Output

Output schema unknown

v3.media.file_id.get

Download a zipped archive of the rendered report. The file is available for download for 72 hours.
The zip file will be named <PRODUCT>_<REPORT_ID>.zip
The csv file in the zip archive will be named as report_<PRODUCT>_<ACCOUNT_ID>_<DATE>.csv the date will be formatted as yyyyMMdd.

nexmo_reports.v3.media.file_id.get({
  "file_id": ""
}, context)

Input

  • input object
    • file_id required string: UUID of the file.

Output

  • output object
    • report array: The report in CSV format inside the zip archive.
      • items object

Definitions

ASR

CONVERSATIONS

MESSAGES

NUMBER-INSIGHT

SMS

VERIFY-API

VOICE-CALL

WEBSOCKET-CALL

_links

  • _links object
    • download_report object
      • href string: URL pointing to the generated report.
    • self object
      • href string: URI of this document.

_links_create_report

  • _links_create_report object
    • self object
      • href string: URI of this document.

account_id

  • account_id string: The account ID (API key) you wish to search for. This can differ from the API key in the authorization header because some accounts can request reports for other accounts, e.g. a primary account owner wants to create a report for one of its subaccounts.

account_ref

  • account_ref string: Search for messages with this account_ref.

application_id

  • application_id string: Search only for requests attached to a particular Application ID.

asr_fields

asr_response_create_report

asr_response_get_report

asr_status

  • asr_status string (values: ok, error): Search only for ASR with corresponding status.

asr_status_description

  • asr_status_description string: ASR error message.

call_end_date

  • call_end_date string: Date of the end of the call.

call_start_date

  • call_start_date string: Date of the start of the call.

callback_url

  • callback_url string: URL to send a callback upon completion of the report. This POST callback contains the same information as the response to Get status of report.

client_ref

  • client_ref string: Search for messages with this client_ref.

conversation_id

  • conversation_id string: Search only for Voice calls attached to this particular Conversation. This should include the "CON-" prefix.

conversation_type

  • conversation_type string (values: ip-voice, cs-custom-event): Type of conversation request. Only used, and is required, when product is CONVERSATIONS.

conversations_fields

conversations_response_create_report

conversations_response_get_report

conversations_user_id

  • conversations_user_id string: User ID of the caller.

country

  • country string: Country where the request was sent.

country_name

  • country_name string: Country name where the request was sent.

csv_asr

csv_conversations_ip_voice

csv_messages_inbound

csv_messages_outbound

csv_ni

csv_sms_inbound

csv_sms_outbound

csv_verify

csv_voice

csv_websockets

currency

  • currency string: Currency of the price of the request.

date

  • date string: Date of the request.

date_end

  • date_end string: ISO-8601 extended time zone offset or ISO-8601 UTC zone offset formatted date (format yyyy-mm-ddThh:mm:ss[.sss]±hh:mm or yyyy-mm-ddThh:mm:ss[.sss]Z) for when report should end. It is exclusive, i.e. the provided value is strictly greater than the value in the field date_received in the CDR.
    If unspecified, defaults to the current time.

date_finalized

  • date_finalized string: Date when the request was finalized.

date_start

  • date_start string: ISO-8601 extended time zone offset or ISO-8601 UTC zone offset formatted date (format yyyy-mm-ddThh:mm:ss[.sss]±hh:mm or yyyy-mm-ddThh:mm:ss[.sss]Z) for when reports should begin. It filters on the time the API call was received by Vonage and corresponds to the field date_received (date_start for Voice) in the report file. It is inclusive, i.e. the provided value is less than or equal to the value in the field date_received (date_start for Voice) in the CDR.
    If unspecified, defaults to seven days ago.

direction

  • direction string (values: inbound, outbound): Direction of the communication, either inbound (received by our services), or outbound (originated from our services). Required for products SMS and MESSAGES. Optional for VOICE-CALL. Invalid for CONVERSATIONS, NUMBER-INSIGHT, VERIFY-API.

duration

  • duration integer: Duration of the call in seconds.

error_code

  • error_code string: Error code of the request.

error_code_description

  • error_code_description string: Description of the error code of the request.

estimated_price

  • estimated_price string: Estimated price of the verify request.

file_id

  • file_id string: Id of the generated report file.

first_event_date

  • first_event_date string: Date of the first verify event.

from

  • from string: Request from this number.

id

  • id string: Search only messages with the specified uuid.

ids_not_found

  • ids_not_found string: If you request multiple records using a comma-separated list of UUIDs, then the UUIDs of any records not found are listed in this field.

include_message

  • include_message boolean: Include the text of messages in the report.

include_subaccounts

  • include_subaccounts boolean (values: true, false): Whether to include subaccounts or not.

instance

  • instance string

ip_voice_leg_id

  • ip_voice_leg_id string: Id of the leg.

ip_voice_status

  • ip_voice_status string: Status of the conversation evnet.

items_count

  • items_count integer: The number of rows in the resulting file (when report has been completed).

json_sms_inbound

json_sms_inbound_with_body

json_sms_outbound

json_sms_outbound_with_body

last_event_date

  • last_event_date string: Date of the last verify event.

latency

  • latency integer: Latency of the request in ms.

locale

  • locale string: Locale used for the TTS.

message_body

  • message_body string: Body of the message sent. Only present if include_message parameter is set to true.

message_id

  • message_id string: Id of the request.

messages_error_code

  • messages_error_code string: Error code of the message.

messages_fields

messages_provider

  • messages_provider string: Provider of the message.

messages_response_create_report

messages_response_get_report

messages_status

  • messages_status string: Status of the message.

network

  • network string: Network used to send the request.

network_name

  • network_name string: Name of the network used to send the request.

ni_country

  • ni_country string: Country of the looked up number.

ni_country_name

  • ni_country_name string: Country name of the looked up number.

ni_first_name

  • ni_first_name string: First name of the owner of the looked up number.

ni_last_name

  • ni_last_name string: Last name of the owner of the looked up number.

ni_network

  • ni_network string: Network of the looked up number.

ni_network_name

  • ni_network_name string: Network name of the looked up number.

ni_network_type

  • ni_network_type string: Network type of the looked up number.

ni_number

  • ni_number string: Number looked up for this request.

ni_ported

  • ni_ported string: Is the looked up number ported.

ni_product_type

  • ni_product_type string: Type of Number Insight request.

ni_reachable

  • ni_reachable string: Is the looked up number reachable.

ni_response_code

  • ni_response_code string: Response code of the Number Insight request.

ni_status

  • ni_status string: Status of the Number Insight request.

ni_valid

  • ni_valid string: Is the looked up number valid.

number

  • number string: Search only request for the target number.

number_insight_fields

number_insight_response_create_report

number_insight_response_get_report

number_type

  • number_type string: Type of phone number to which requests are sent.

price

  • price number: Price of the request.

pricing_model

  • pricing_model string: Pricing model used for this request.

product

  • product string (values: SMS, VOICE-CALL, WEBSOCKET-CALL, VERIFY-API, NUMBER-INSIGHT, MESSAGES, CONVERSATIONS, ASR): Which product you wish to generate a report for.

product_asr

  • product_asr string (values: SMS, VOICE-CALL, WEBSOCKET-CALL, VERIFY-API, NUMBER-INSIGHT, MESSAGES, CONVERSATIONS, ASR): Which product you wish to generate a report for.

product_conversations

  • product_conversations string (values: SMS, VOICE-CALL, WEBSOCKET-CALL, VERIFY-API, NUMBER-INSIGHT, MESSAGES, CONVERSATIONS, ASR): Which product you wish to generate a report for.

product_messages

  • product_messages string (values: SMS, VOICE-CALL, VERIFY-API, NUMBER-INSIGHT, MESSAGES, CONVERSATIONS, ASR): Which product you wish to generate a report for.

product_ni

  • product_ni string (values: SMS, VOICE-CALL, WEBSOCKET-CALL, VERIFY-API, NUMBER-INSIGHT, MESSAGES, CONVERSATIONS, ASR): Which product you wish to generate a report for.

product_sms

  • product_sms string (values: SMS, VOICE-CALL, WEBSOCKET-CALL, VERIFY-API, NUMBER-INSIGHT, MESSAGES, CONVERSATIONS, ASR): Which product you wish to generate a report for.

product_verify

  • product_verify string (values: SMS, VOICE-CALL, WEBSOCKET-CALL, VERIFY-API, NUMBER-INSIGHT, MESSAGES, CONVERSATIONS, ASR): Which product you wish to generate a report for.

product_voice

  • product_voice string (values: SMS, VOICE-CALL, WEBSOCKET-CALL, VERIFY-API, NUMBER-INSIGHT, MESSAGES, CONVERSATIONS, ASR): Which product you wish to generate a report for.

product_websocket

  • product_websocket string (values: SMS, VOICE-CALL, WEBSOCKET-CALL, VERIFY-API, NUMBER-INSIGHT, MESSAGES, CONVERSATIONS, ASR): Which product you wish to generate a report for.

receive_time

  • receive_time string: Time at which the report request was received by the service.

report_request

report_response

report_response_create_report

report_response_top_level

request_id

  • request_id string: UUID of the request.

request_status

  • request_status string (values: PENDING, PROCESSING, SUCCESS, ABORTED, FAILED, TRUNCATED): Status of the request.

request_status_create_report

  • request_status_create_report string (values: PENDING, PROCESSING, SUCCESS, ABORTED, FAILED, TRUNCATED): Status of the request.

sms_event_count

  • sms_event_count integer: Number of sms sent for this verify request.

sms_fields

sms_response_create_report

sms_response_get_report

sms_status

  • sms_status string (values: delivered, expired, failed, rejected, accepted, buffered, unknown): Search only for sms with the corresponding status.

start_time

  • start_time string: Time at which the report processing of the report has started.

status

  • status string: Search only for conversation events with the specified event status.

to

  • to string: Request to this number.

total_price

  • total_price number: Total price of the request.

tts_event_count

  • tts_event_count integer: Number of tts sent for this verify request.

verify_api_fields

verify_api_response_create_report

verify_api_response_get_report

verify_status

  • verify_status string: Status of the verify request.

voice_call_fields

voice_call_response_create_report

voice_call_response_get_report

voice_status

  • voice_status string (values: started, ringing, answered, machine, completed, timeout, failed, rejected, cancelled, busy): Search only for voice call with the corresponding status.

voice_status_description

  • voice_status_description string: Description of the status of the call.

websocket_call_fields

websocket_call_response_create_report

websocket_call_response_get_report

websocket_status

  • websocket_status string: Search only for WebSocket call with corresponding status.

Readme

Keywords

none

Package Sidebar

Install

npm i @datafire/nexmo_reports

Weekly Downloads

1

Version

3.0.0

License

MIT

Unpacked Size

149 kB

Total Files

4

Last publish

Collaborators

  • datafire