Documents

          Docs / Api Docs /MSISDN

          Api Docs / MSISDN

          MSISDN


          This is where you will find all the documentation related to our MSISDN APIs.

          Get MSISDN


          Gets the user phone number

          Ayoba.getMsisdn()
          

          Example


          function getMsisdn() {
              var msisdn = Ayoba.getMsisdn();
              return msisdn
           }
          

          Parameters
          No parameters
          Returns
          String: the user’s MSISDN. Example: +93777777778
          Permissions
          MSISDN

          Get SelfJid


          Example

           function getSelfJid() {
               var selfJid = getURLParameter("jid")
               document.getElementById("inputText").value = selfJid
               return selfJid
           }
          

          Parameters
          No parameters
          Permissions
          No permissions required

          The following method must be implemented to retrieve the call response:

          function getSelfJid()
          

          Compose message


          Puts a text on the compose bar of the chat screen without sending the message

          Ayoba.composeMessage(message); 
          

          Example


          Ayoba.composeMessage(message);
          

          Parameters
          • message String: message to put on the compose bar
          Returns
          No return value
          Permissions
          No permissions required

          Send message


          Sends a chat message directly without putting the text on the compose bar of the chat screen

          Ayoba.sendMessage(message)
          

          Example


          Ayoba.sendMessage(message);
          

          Parameters
          • message String: message to send directly
          Returns
          No return value
          Permissions
          SendMessage

          Get Send Message


          Returns true if the user has accepted the permission to send a message.

          Ayoba.getCanSendMessage()
          

          Example


          Ayoba.getCanSendMessage()
          

          Parameters
          No parameters
          Returns
          • Boolean: The function returns true if user has accepted the permission to send a message; if not, returns false
          Permissions
          No permissions required

          Start Conversation


          Sends an event to Ayoba application to start conversation on the service.

          ayoba.startConversation(jid);
          

          Example


          string jid = "62c3bdfffc5c7c3bb30bc7beda52531d2d2df@dev.ayoba.me";
          function startConversation() {
             ayoba.startConversation(jid);
            }
          

          Parameters
          jid
          Returns
          No return value
          Permissions
          No permissions required

          Next Steps

          That’s all to read on the MSISDN documents. Continue to learn more about our APIs, next is some documentation on our Location APIs

          Previous
          Getting Started

          Next
          Location