0% found this document useful (0 votes)
2 views5 pages

MongoDB Shell Script Guide for Messaging

This document is a guide for using three MongoDB shell scripts designed to troubleshoot message delivery and sender configurations. The scripts allow users to fetch message details by ID, retrieve sender configuration, and analyze messages sent by customers on specific dates. It also outlines system requirements and provides usage scenarios for each script to address common issues.

Uploaded by

shaikahamad
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

MongoDB Shell Script Guide for Messaging

This document is a guide for using three MongoDB shell scripts designed to troubleshoot message delivery and sender configurations. The scripts allow users to fetch message details by ID, retrieve sender configuration, and analyze messages sent by customers on specific dates. It also outlines system requirements and provides usage scenarios for each script to address common issues.

Uploaded by

shaikahamad
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MongoDB Shell

Script Guide

© Copyright Twixor, All Rights Reserved


TABLE OF CONTENTS
1 INTRODUCTION ................................................................................................. 3
1.1 Purpose of the Document .................................................................................................... 3
1.2 Scripts Included .................................................................................................................... 3
1. get_message_details_by_id.sh ..................................................................................... 3
2. get_sender_details.sh .................................................................................................... 3
3. get_message_by_sender.sh .......................................................................................... 4
2 SYSTEM REQUIREMENTS ..................................................................................... 4
2.1 Database Access .................................................................................................................. 4
1 INTRODUCTION
1.1 Purpose of the Document
This guide provides details on how to use three shell scripts to troubleshoot issues related to
message delivery and sender configurations. These scripts help to check message status, verify
sender configuration, and analyze customer message activity through MongoDB.

1.2 Scripts Included


1. get_message_details_by_id.sh
Use this script to fetch the complete message details using a Message ID (such as Twixor ID or
RCM Message ID). It returns the delivery status, platform type, error code, error message, and
delivery timestamp.

sh get_message_details_by_id.sh <Message_ID>

Example:
sh get_message_details_by_id.sh 684143b15f37ab5b5f1d326a

This script is used to check why a message failed or confirm if a message was successfully
delivered.

2. get_sender_details.sh
This script is used to fetch the complete configuration details of a sender using the sender ID.
The sender ID is typically a phone number that has been registered as part of the messaging
platform configuration. It helps you identify how the sender is set up and what metadata is
attached to it (like WABA ID, platform type, webhook URLs, etc.)

sh get_sender_details.sh <Sender_ID>

Example:
sh get_sender_details.sh 91987456310
3. get_message_by_sender.sh
Use this script to retrieve all messages sent by a customer on a specific date, through a particular
Sender ID.

sh get_message_by_sender.sh <Date> <Customer_Number> <Sender_ID>

Example:
sh get_message_by_sender.sh 05-06-2025 919874563210 14439713087

All 3 inputs are mandatory:


o Date: Format DD-MM-YYYY
o Customer number: Phone number of the user
o Sender ID: WABA number used for sending

You can check if any messages were sent on the given date.
If nothing appears, it means no attempt was made to send — could be due to journey issues,
invalid template, or misrouting.
If status is FAILED, you can then use the message ID in Script 1 to check the exact failure
reason.

2 SYSTEM REQUIREMENTS
To use these scripts:

• The system must have MongoDB installed and be able to connect to the MongoDB
database.
• Ensure your terminal session has access to the MongoDB instance.

2.1 Database Access


Update connection settings inside the scripts to point to the correct MongoDB host and
credentials if required.

For example:
# MongoDB connection details
HOST="[Link]"
PORT="57017"
DB="MeOnCloud"
Usage Scenario

Use case Script to Run Solution


Message not delivered get_message_details_by_id.sh See failure reason (e.g.,
wallet issue, API error)
Sender setup not working get_sender_details.sh Verify webhook, WABA ID,
channel details
Customer not receiving get_message_by_sender.sh Check message history for
messages that day

You might also like