Power Automate Send E-Mail via HTTP Post Error - sharepoint

I have set-up an approval workflow where a user gets notified if his / her request has been submitted for approval. The request is submitted via Microsoft Forms, the workflow then takes the submitters e-mail as the "To" for said notification. This is done via a HTTP Post Action so that the e-mail is directly from SharePoint and not me, the process owner.
This works fine for most user e-mails... however there are some cases where this error message pops up:
{"odata.error":{"code":"-2130242040, Microsoft.SharePoint.SPException","message":{"lang":"en-US","value":"The e-mail message cannot be sent. Make sure the e-mail has a valid recipient."}}}
My action is configured as follows:
HTTP Post Action Configuration
The flow successfully retrieves the user's e-mail address but it is not sending it. This happens to roughly 20% of users.
Thank you!
The body of an unsuccessful e-mail HTTP Post:
"body": {
"status": 400,
"message": "{\"odata.error\":{\"code\":\"-2130242040, Microsoft.SharePoint.SPException\",\"message\":{\"lang\":\"en-US\",\"value\":\"The e-mail message cannot be sent. Make sure the e-mail has a valid recipient.\"}}}\r\nclientRequestId: xyz\r\nserviceRequestId: xyz",
"source": "https://www.sharepoint.com/Teams/Team_Name/_api/SP.Utilities.Utility.SendEmail",
"errors": []
}
}
Successful HTTP Post:
{
"odata.null": true
}

Related

Guest User Invitation Not Sending Email

I am using the guest user invitation api as defined here to add a guest user to my Active Directory.
The post request succeeds with a 201 response code and returns the following data:
{
"#odata.context":"https://graph.microsoft.com/v1.0/$metadata#invitations/$entity",
"id":"xxx",
"inviteRedeemUrl":"https://invitations.microsoft.com/redeem/?tenant=xxx&ticket=xxx&ver=2.0",
"invitedUserDisplayName":"xxx",
"invitedUserType":"Guest",
"invitedUserEmailAddress":"xxx#gmail.com",
"sendInvitationMessage":false,
"inviteRedirectUrl":"http://localhost:4200/",
"status":"PendingAcceptance",
"invitedUserMessageInfo":{
"messageLanguage":null,
"customizedMessageBody":null,
"ccRecipients":[
{
"emailAddress":{
"name":null,
"address":null
}
}
]
},
"invitedUser":{
"id":"xxx"
}
}
When I check the active directory using the Azure UI, I see that the user is created in the directory. But I never receive an invitation email, unless I click the resend invite button in the UI for the user.
How can I make sure that an invite email is sent when I send my request to the invite api, without having to manually click the resend invite button for the user?
Silly mistake on my part. You need to add the sendInvitationMessage: true property in your request json payload in order to send the email. The documentation for allowed properties in your request object is here https://learn.microsoft.com/en-us/graph/api/resources/invitation?view=graph-rest-1.0

Redirecting to sender view URL displays an error

When I redirect to a generated "sender" URL, DocuSign displays a page that states
Login Unsuccessful
Sorry, an error occured. Please try again.
retry.
Details
Our code hasn't changed in months, and today is the first day I have become aware of this problem. Previously, the user would get logged in and would be allowed to modify the envelope before sending. Here are the details regarding the initial envelope being sent:
Sent as API account (ApiAccount) on behalf of a user (UserAccount)
We are then creating a "sender" view for the UserAccount.
https://demo.docusign.net/restApi/v2/accounts/{ApiAccount}/envelopes/{envelopeId}/views/sender
X-DocuSign-Authentication: {"Username":"{ApiAccount}", "Password":"{ApiAccount_Password}", "SendOnBehalfOf": "{UserAccount}", "IntegratorKey":"{IntegratorKey}"}
Content-Type: application/json
Results
The DocuSign API returns the URL as expceted:
"url": "https://demo.docusign.net/Member/StartInSession.aspx?StartConsole=1&t=2a289ba9-69ff-4986-946e-3b1c25b9db67&DocuEnvelope={envelopeId}&send=1"
When I navigate to the provided URL, I get the above error message displayed in the HTML. The URL that displays this error message is:
https://appdemo.docusign.com/authentication?back=/prepare/{envelopeId}/add-fields
Additional Details
I have done the following:
Confirmed that the API and user account logins are both valid (passwords are correct).
Ran DocuSign logging on the user account (that should be logged in). No logs were generated to indicate what the problem was.
Our code that generates the redirection URL has not changed in months and worked correctly until today. Also, doing a simple AJAX POST like above displays the error.
This is for the demo environment.

Docusign Connect API set the envelope on Queue but the retryCount don't change

I am using the ConnectEvents Api's.
Specifically the following api's
retryForEnvelope
Republishes Connect information for the specified envelope.
retryForEnvelopes
Republishes Connect information for the specified set of envelopes. The primary use is to republish Connect post failures by including envelope IDs for the envelopes that failed to post in the request. The list of envelope IDs that failed to post correctly can be retrieved by calling to [ML:GetConnectLog] retrieve the failure log.
I get this JSON response
{
"retryQueue": [
{
"envelopeId": "aaaaaa-bbbb-cccc-dddd-eeeeeeeeee",
"configId": "Envelope",
"configUrl": "",
"status": "Queued",
"statusMessage": ""
}
]
}
The response show me that the webhook is on queue but if i try to call - listFailures
I can see that the retryCount property is still 0
Something can i be missing?
Additional Notes:
-If i go to the connect console on the admin page and i click the Republish button from the UI console, the value is still 0
-I am testing with a demo account, not sure if there is any policy of the retry endpoint on demo.
Thanks!!

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