Send metadata in WhatsApp Cloud Api - node.js

Somehow, in order to send a response to the client, I must be able to pass the user's id as metadata or parameter, for example: The reservation request is sent to a restaurant, after that, the restaurant confirms the reservation, in the Confirmation A WhatsApp is sent to the user to inform him that his reservation is confirmed.
For it:
WhatsApp with restaurant id metadata to confirm.
Whatsapp with the confirmation to the user (I must know the id of the
restaurant)
In the object returned by WhatsApp I have a context, however I can't find any method to get the information from the context.
I want to send the object:
"messaging_product": "whatsapp",
"to": "52" + recipient,
"metadata":{
"idUser": 60,
"idBranch": 76
},
"type": "template",
and retrieve the context to know the ID.

Unfortunately, WhatsApp Business API does not have any option to pass metadata in the send message API,
The real approach is you need to store that message-id in your database, whenever you receive webhook object, match that object's message-id in the stored message-id from the database, and do whatever further actions.

Related

How to get user id using email id in teams using python

I'm creating a bot to notify a user after an action has been done. Where i'm able to get my details using the below(screenshot) code.
Now in order to send a message to a user through a bot i would need his/her ID before hand to send a notification like in the above case i'm able to extract my info as i'm already logged in Teams. Unfortunately alphanumeric ID is very difficult to use and needs to be there before requesting and sending the notification.
Below is the JSON result if the ID is already known.
Response body
{
"id": "29:1GcS4EyB_oSI8A88XmWBN7NJFyMqe3QGnJdgLfFGkJnVelzRGos0bPbpsfJjcbAD22bmKc4GMbrY2g4JDrrA8vM06X1-cHHle4zOE6U4ttcc",
"objectId": "9d3e08f9-a7ae-43aa-a4d3-de3f319a8a9c",
"givenName": "Larry",
"surname": "Brown",
"email": "Larry.Brown#fabrikam.com",
"userPrincipalName": "labrown#fabrikam.com",
"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47",
"userRole":"user"
}
How i can get the unique ID of the user by using email id so that i can send a personal message to him/her using bot.
There is an option to fetch conversationChatId to send proactive message.
Before you fetch the conversation Id, you should check whether your bot is currently installed for a message recipient or not.
Note: Installation of app via Graph API triggers conversation update event for Bot.

DocuSign ID Check with Embedded signing for documents sent via JAVA SDK

I'm trying to achieve ID Check on embedded signing through an envelope sent via Docusign Java SDK. I am able to make it work through remote signing however, I get the following error on embedded signing.
{
"errorCode": "INVALID_REQUEST_PARAMETER",
"message": "The request contained at least one invalid parameter. The value of AuthenticationMethod is invalid."
}
I'm fully aware of another post on the same topic posted in 2013 (DocuSign ID Check with Embedded signing). The difference here is that I'm not using any document templates but sending the documents in the envelope itself. Based on the comments a bug was logged with bug id 30830 but I can't say whether this was resolved.
Also, I have already added the settings that I know that are required for ID Check.
signer.setRequireIdLookup("true");
recipientViewRequest.setAuthenticationMethod("ID Check $");
Can anyone advise on what I'm missing ?
It's a little hard to tell from your question but from what I gather you might be setting the properties on the wrong request. As you know when creating a remote signing request you can do it through just one API request - Envelopes: create.
For embedded signing you still first create an envelope (with an embedded recipient) but then you need to generate the signing URL by calling EnvelopeViews: createRecipient.
When setting the ID Check authentication for your recipient you still need to assign this in the first request (ie the create envelope call) so that recipient is configured like so:
"recipients": {
"signers": [
{
"idCheckConfigurationName": "ID Check $",
"requireIdLookup": "true",
...
}
]
}
THEN, in the request body of the second call you need to set the authenticationMethod with the same value and provide the other required params to identify the signer.
Please confirm you are following this flow and if so and still stumped then post the actual JSON that you are sending for your requests and we should be able to determine from there.

C# Docusign API - Getting Remote Signing View URL

After running the console app, our users get an email with the signing link to Docusign making them remote signers.
What I want to be able to do is get those links from their emails.
I did some research and this is what each url is made of
https://demo.docusign.net/Member/EmailStart.aspx?
a=65d11cf7-d3b7-49a1-8000-6192b6227d71& <<< Unique Activity ID? Always different in all URLs
acct=a0e816ac-3919-475e-a826-34c2c33f90e7& <<< Some kind of role ID (stays same between envelopes and users of the same role, I have it
for my roles..just don't know how to get it programmatically
er=62378ec0-39ce-495e-84e4-e0e598fab3cc& <<<< envelopesApi.ListRecipients(.....) .Signers[n].RecipientIdGuid, able to get it
espei=30cec285-39cd-45a3-bb8e-7bd0560dcd80 <<<< ENVELOPE ID, able to get it
The first parameter is the main focus of my question - it is a total mistery what is it and how to get it
The second parameter looks like a role_id, but I don't know how to get it other than hard-coding values for each of my roles
The other two parameters aren't a concern.
Does anybody know how to get ahold of the first two parameters using the C# Docusign API?
Or even better, is there a way to get the recipients signing url links using the same API?
To obtain the signing URL you will have to set the recipient as an embedded recipient.
After the envelope is created, use the createRecipient:EnvelopeViews api to retrieve the Signing URL.
You have to set the recipient clientUserId parameter to mark a recipient as an embedded recipient.
Request
{
"userName": "name",
"email": "examble#email.com",
"clientUserId": "clientUserId",
"authenticationMethod": "email",
"returnUrl": "your app url"
}

How to set up a webhook in servicem8?

I am not sure where/how to set up a webhook in servicem8. I want to trigger an update when a Job status changes from Quote to Work Order.
I have read the documentation, but am not clear on the process.
Webhooks in ServiceM8 are only supported when using OAuth authentication using an access token, so you will need to register for a free developer account to get your OAuth Client Id and Secret. If you have not yet done so, follow the steps listed here:
http://developer.servicem8.com/docs/the-basics/public-applications/
Once you have OAuth authentication working, Subscribe to the 'Job' webhook to receive notifications when job data has changed. Do this by POSTing to https://api.servicem8.com/webhook_subscriptions
As mentioned on http://developer.servicem8.com/docs/platform-services/webhooks/ , the subscribe request should include:
object='job'
fields='status'
callback_url - Set this to the URL you wish to receive notifications
Once you subscribe to the webhook, you will immediately receive a request at your callback url to challenge you own this url. The request will contain URL parameters mode=subscribe, and a challenge value. To successfully confirm the challenge request you need to return a 200 result, with the body of the response set to the challenge code.
If you successfully confirm the challenge code request, you will start receiving notifications at your callback_url for any changes to job data within your ServiceM8 account. The notification you receive will contain JSON data similar to
{
"object": "job",
"entry": {
"changed_fields": ["status"],
"time": "2015-01-01 00:00:00",
"uuid": "de305d54-75b4-431b-adb2-eb6b9e546013"
},
"resource_url": "https://api.servicem8.com/api_1.0/job/de305d54-75b4-431b-adb2-eb6b9e546013.json"
}`

Docusign Powerforms Embed Success Status

I'm working on a PHP application that has multiple products which require signing from a customer before going for the product.
I'm using powerforms link to embed them on my application (using iFrame).
They work fine. But the problem is I need to store the document signed status in my database.
The we can set a return URL in the Docusign Preferences Page. But that will be static and I won't have a clue of what product the user has selected.
References:
Powerform Docs
You can use DocuSign Connect to receive real-time notifications of envelope events (for example, Envelope Completed). At a high-level, it works like this:
You login to DocuSign web console (as Admin) and create a Custom Connect Configuration. As part of creating this configuration, you'll specify the endpoint (http address) that you want Connect to send notifications to, and which events you want to be notified of.
You build a "listener" -- i.e., the web page that will receive the HTTP POST messages from DocuSign Connect, and process those messages.
When an Envelope or Recipient event occurs (for which you've enabled notifications in your DocuSign Connect Configuration), Connect will almost immediately send an HTTP POST to your listener. This message contains XML with info about the Envelope, Recipients, Documents, Fields, etc. You'll develop your listener such that it parses the XML message to determine Envelope status, data field values, etc. and then can respond appropriately within the context of your application (i.e., in your scenario, your listener would use the XML message from Connect to determine envelope status and which product(s) the user selected).
See this guide (http://www.docusign.com/sites/default/files/DocuSign_Connect_Service_Guide.pdf) and this page in the DocuSign Dev Center (http://www.docusign.com/developer-center/explore/connect) for more detailed information on configuring/using DocuSign Connect.
UPDATE - Using Custom Fields to populate unique Identifier for Envelope
Depending on the nature of your use case, you might need to use an "envelope custom field" to populate a unique identifier for each Envelope in the "create/send envelope" request, so that your listener application has a way of identifying the envelope when it receives a Connect message. (An 'envelope custom field' is simply a custom piece of metadata on an envelope.) Simply set the customFields property in your Create Envelope request, and populate a single textCustomFields item with the unique identifier. For example:
{
"emailSubject": "Please sign this",
"emailBlurb": "Please sign...thanks!",
"customFields": {
"textCustomFields": [
{
"value": "1234567",
"required": "false",
"show": "true",
"name": "ProductId"
}
]
},
"status": "sent"
...
}
See the REST API Guide (http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf) for more detailed info about using Custom Envelope Fields.

Resources