web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

SMS TO CUSTOMER ON SALES ORDER INVOICE

(0) ShareShare
ReportReport
Posted on by

I want to send SMS to customers when a sale order is invoiced..

Now i have a API and a API KEY only..

APi Key will fulfill the value of username and password ..

Now i need some code to use the API Key to send sms to customers

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,037 Super User 2025 Season 2 on at

    Hi Udit,

    Please elaborate. What API are you referring to? Is this a third party API?

  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    You can use business event docs.microsoft.com/.../home-page

    Push it to Power Automate, there are connector there that allow you to send sms.

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hello Udit,

    Agree with Ievgen that you can leverage business events and PowerAutomate to achieve that.

    Irrespective of that, I would like to ask why you need that SMS?

    If I would be your customer this is probably a message I would not like to receive ... maybe because I don't like to spend money and getting a SMS that tells me that an invoice that I have to pay soon arrives is not something I am looking out for :-)

    Best regards,

    Ludwig

  • Community Member Profile Picture
    on at

    Hi andre,

    Yes its a third party API

  • Community Member Profile Picture
    on at

    That is ok , but we need to fufill the requirement ..

  • Community Member Profile Picture
    on at

    Hi ievgen

    We dont have knowledge on Power automate, so want to do it from D365fo ..

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    With Power Automate you can do it with no development at all.

    But if you want to connect to some third party API from D365FO, you need to ask the owner of that API for documentation. They might even have some C# example on how to call it. Then you could implement similar C# code, and use it from your x++ code to send the SMS.

    Once you have that documentation and if you still need help, please share all the info with us and we can try to help. Thanks!

  • Community Member Profile Picture
    on at

    Heyy nikolaos,

    Below is the documentation code to call API Key ,

    Now need it as it suits for x++..

    import urllib.request

    import urllib.parse

    from fpe import settings

    def send_sms(numbers, message):

       data = urllib.parse.urlencode({'apikey': settings.SMS_API_KEY, 'numbers': numbers,

                                      'message': message, 'sender': settings.SMS_SENDER_ID, 'test': settings.TEST_SMS})

       data = data.encode('utf-8')

       request = urllib.request.Request("api.textlocal.in/.../

       f = urllib.request.urlopen(request, data)

       fr = f.read()

       return fr

    ```

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    You could use example from this site to create a C# POST request (see chapter "C# HttpClient POST request"):

    zetcode.com/.../

    In that example there's class "Person" that contains properties that you need to generate the request JSON. In your case you would create class SMS with variables for apikey, numbers, message, sender and test (not sure what this last variable is used for).

    First concentrate on getting your C# code to work. Once it works, use it from your x++ code.

  • Martin Dráb Profile Picture
    237,898 Most Valuable Professional on at

    This is a piece of Python code, not a documentation.

    If you really hate reading documentation (which is not a good thing for a programmer), you can simply rewrite the Python code to C# or X++. You can copy the message, provide actual values instead of settings.SMS_API_KEY, settings.SMS_SENDER_ID and settings.TEST_SMS, encode it and use it inside the body of an HTTP request.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans