SAP Cloud Application Programming Model CAP: Display Message Toast - toast

Using SAP Cloud Application Programming Model (CAP), in a Node.js application with Fiori Elements like the bookshop sample,
how can I display a Message Toast
to indicate that an action completed successfully?

Using the request object req passed to the event handler:
req.notify("Your success message goes here!");
See also: https://cap.cloud.sap/docs/node.js/requests#req-msg
Ideally, the message should be translated a.k.a. localized.
See also: https://cap.cloud.sap/docs/node.js/app-services#i18n

The part you are referring to is the backend. I'm not sure if you can trigger Toast Messages from backend. But you need to catch the message and display it at the frontend part of your application by using the MessageToast object.
https://cap.cloud.sap/docs/node.js/requests#req-msg This seems like a suggestion of in which way you "typically" handle the message.
You need to check severity of the message that is returned from the backend (http request) and use MessageToast.show or MessageBox.error or MessageBox.warning etc.

Related

Add reaction to existing posts or comments

How can we "like" or add other reactions to someone else's channel message or comment via the Graph API?
I've not done this myself, but it certainly looks possible. You need to reply to the message, as per https://learn.microsoft.com/en-us/graph/api/channel-post-messagereply?view=graph-rest-1.0&tabs=http and notice that it has a "reactions" collection. That would be populated with a chatMessageReaction type, as per https://learn.microsoft.com/en-us/graph/api/resources/chatmessagereaction?view=graph-rest-beta
Note of warning: chatMessageReaction is a beta type though, so just be aware you need to call the beta endpoint, and it has a risk to use in production code as things might change.
Update: We reached out to MS Support and received the following info: "The API to reply to a message using a POST /replies request is solemnly for issuing a reply to a message, and not to edit the status of the parent message itself. Moreover, the "update chatMessage" API which is a PATCH /messages and which is the only API to edit a parent message only supports updating the policyViolation property of a chatMessage. Essentially, there is currently no documented API / already-present API examples on how to add a reaction, making this purely unsupported."

Updating a Twilio "send message" message-body in a Flow using REST API

I have dynamically changing data that I would like to push to the message body replies in my Flows for the most up to date info for users.
Send Message Widget Doc is here:
https://www.twilio.com/docs/studio/widget-library/send-message
Thus I'm looking for help on what the proper API format is to POST / PUT (using curl) to the Twilio API to update a Message Body in this widget of a Flow.
For example if I have a "Send Message" widget and its name is send_message_1, what would the format be for the API?
(I know I can add a http GET to my Flow to fetch dynamic data, but this is not an option in my work environment at this time. So I'm looking to manually POST the data.)
Thanks!
You cannot POST data to an active Twilio Studio flow. You will need to bring in content via the HTTP Request Widget or Run Function widget and then use liquid syntax for the body of the Send Message widget to represent this dynamic content.
Alan

Getting a warning message while creating a REST API in IBM IIB V 10.0.0.7

I am getting the below warning message in the automatically generated REST API message flow while creating a REST API (by importing a swagger document) -
"This message flow is automatically generated.
Do not edit this message flow.
If you edit the message flow, your changes will be overwritten without a warning."
The IBM Integration Bus version we are using is V 10.0.0.7
What's the significance of this error? And under what conditions, code (what code) will be overwritten?
You should make the necessary changes using REST API Description. Message flow is generated from this description, so it will be overridden the next time something in REST API Description changes and the message flow is regenerated.
Edit: You can add a subflow to handle errors using error handling in your REST API Description:

user notifications in Grails

I'm building an application using Grails 2.5.1 , i want to implement a user's notification service ,similar as Stack overflow for instance when the user has unread messages it notifies the user as soon as he login . is there a plugin or a handy way to achieve this ?
thanks
If you want some data (ex: unread messages) on demand (login), then you could include this in the action's returned map or fetch the data from a separate Ajax call when the document.event fires and manipulate the DOM (easily done through jquery, angular, etc.)
If you are looking to update the DOM asynchronously based on events that happen server-side (another user sends a message and you would like to 'instantly' alert the current user), then things become more complicated.
Spring Websocket
There is a grails plugin that we have experimented with and have had success with: grails-spring-websocket. Check out the link for examples and more info.
There is a bean brokerMessagingTemplate that is injected within your service class that has methods to publish a message. On the client, you subscribe to the corresponding message url using javascript. When the callback function is executed, a message has been published - manipulate the DOM as needed.
There are also some controller annotations provided by the plugin, but I don't have experience with them.

How to integrate BurstSMS API into asp.NET application?

I have situation that if anyone send SMS to my virtual number(CallerID) the BurstSMS API will call my handler which get the response from query string and proceed further.
So, I want to know only that ,how and which things needed to integrate the BurstSMS API in my APS.NET application.
I couldn't find the information from the documentation of API site and as well as not any article on the google.
Thanks in advance.
This is what you need to do.
Log in to your account
Go to Messaging -> Keywords
Click Edit from the Actions column of the campaign you would like to receive responses for
In the form which pops up fill in the "Send Response to URL" field with a URL to a script on your server which can process the responses, e.g. www.clienturl.com/sms.php
Click Save
From then on we will forward all SMSes for that campaign to your script with an HTTP GET request. For example, if you send "Property 25" to your longcode, we will call
www.clienturl.com/sms.php?mobile=61430008230&response=Property+25
From that you can see the parameters we use.
You could also add other parameters your own reference such as the longcode or an internal client id by using a different URL in the "Send Response to URL" field, e.g.
www.clienturl.com/sms.php?longcode=61418499440&client=123
In which case we would send to you
www.clienturl.com/sms.php?longcode=61418499440&client=123&mobile=61430008230&response=Property+25
Source burstsms

Resources