DocuSign REST API DELETE method requires a body - docusignapi

For example to remove a member from a signing group you call:
/restapi/v2/accounts/1686083/signing_groups/{groupId}/users
and provide:
{
"users": [
{
"userName": "sample string 1",
"email": "sample string 2"
}
]
}
as the body
But my REST object (in ServiceNow) does not allow me to provide a body when I'm using the delete method. Am I just stuck?

I don't think there is any another way to remove the user from a SigningGroup using API. You can try to update the user in a Signing group to a Dummy Email so that original user will not get email for signing. And once in a while DS Admin can go to WEBApp and manually delete it, if Service now is not allowing DS API delete operation with a body.

If you're using RestMessageV2 in ServiceNow scripted Outbound REST, there's a setRequestBody method you can use to set the request body as a string:
Example in the docs here
var sm = new sn_ws.RESTMessageV2("Update user","post");
var body = "{ ...Message body content... }";
sm.setRequestBody(body);

Related

How can I send documents with http request to power automate?

How can I send array documents and images with an HTTP request to power automate?
I am using type script with nodejs as backend.
Please see the code I am using below:
Services.ts:
sendEmailData( Notice_ID: string, Site_Notice_ID: string,EmailAddress:
string,Issued_To: string,Issue_To_Email: string,Description: string,Documents: any){
const postData: Post = {Notice_ID:Notice_ID, Site_Notice_ID:
Site_Notice_ID,EmailAddress: EmailAddress,Issued_To:Issued_To,
Issue_To_Email: Issue_To_Email,Description:Description, Documents: Documents};
this.http.post(this.SendEmailUrl, postData).subscribe(responseData => {
console.log(responseData)
});
}
Component.ts:
sendEmail(){
// console.log(emailData)
let Description = (document.getElementById("input2") as HTMLInputElement).value
this.postsService.sendEmailData(
emailData.Notice_ID,
emailData.Site_Notice_ID,
emailData.EmailAddress,
emailData.Issued_To,
emailData.Issue_To_Email,
Description,
this.Documents)
}
Power automate HTTP received sample:
{
"Notice_ID": "39208101",
"Site_Notice_ID": "392081",
"EmailAddress": "some#emailaddress.co.za",
"Issued_To": "Jay",
"Issue_To_Email": "some#emailaddress.co.za",
"Description": "",
"Documents": [
{},
{},
{}
]
}
You wanna send documents to PWA flow, right? What is the origin format and what format do you want to save these documents in? Where do you want to save them?
I'm considering you want to send them to PWA by a post request and save it in a OneDrive Business' folder.
{
"Notice_ID": "39208101",
"Site_Notice_ID": "392081",
"EmailAddress": "some#emailaddress.co.za",
"Issued_To": "Jay",
"Issue_To_Email": "some#emailaddress.co.za",
"Description": "",
"Documents": [ {"$content-type":"application/pdf","$content":"your base64 encoded
file here"}]
}
You can take a look at the complete example: https://api.npoint.io/073b1351d9b0cd0c7f88
Then, add the key "Documents" to a variable, like this:
Create an "apply to each" action to run your "documents" list.
For each dictionary in your document list, create a file:
In the "file content" field you can put the "Current action" variable.
Don't forget to create a counter or find some other way to name your created files with different names. You can also bring them named from your application and use the JSON body below:
"Documents": [ {"filename":"myfile.pdf","file":{"$content-
type":"application/pdf","$content":"your base64 encoded
file here"}}]
And set the filename in the "Apply to each":
Change the "file content":
You can use this website for generating base64 encoded files for testing your flow: https://base64.guru/converter/encode/pdf

How to set dialogflow fulfillment response json context without using webhook client?

I want to create a rich response to Facebook integration using Dialogflow fulfillment. I tried using webhook but it's not working and then I try below way directly using response and now I am facing this context binding issue.
I tried below
let responseJson = {};
let rich = [
{
'text': {
'text': [
text
],
},
'platform': 'FACEBOOK'
},
];
responseJson.fulfillmentMessages = rich;
responseJson.outputContexts = context;
response.json(responseJson);
my context JSON
{ name: 'MAINTENANCE_REQUEST', lifespan: 5, parameters: { maintenanceRequest: maintenanceRequest }}
To add a custom payload without a webhook, go to your intent, and scroll to the bottom where it says "responses". Click on the plus sign (picture) and click on the facebook option. Click on the add responses -> custom payload. The format and available fields for the custom payload are described here. Delete the "Text Response" if it's there so the custom payload will be the only one to be returned.

How to get emailBlurb from template via DocuSign REST API

If I load all templates via the docuSign api the property emailBlurb is always an empty string, emailSubject is available.
It is a spring boot 2 REST service.
public EnvelopeTemplateResults getAllTemplates() {
// Check if valid token available
loginService.checkToken();
EnvelopeTemplateResults templateResult = new EnvelopeTemplateResults();
TemplatesApi templatesApi = new TemplatesApi(com.docusign.esign.client.Configuration.getDefaultApiClient());
List<EnvelopeTemplateResult> templateList;
try {
TemplatesApi.ListTemplatesOptions options = templatesApi.new ListTemplatesOptions();
options.setInclude("notifications,recipients,custom_fields,folders");
templateResult = templatesApi.listTemplates(configuration.getAccountId(), options);
templateList = templateResult.getEnvelopeTemplates();
templateResult.setEnvelopeTemplates(templateList);
} catch (ApiException e) {
logger.error("Error in get all templates: " + e.getLocalizedMessage());
}
return templateResult;
}
Mike,
Please look in here - https://developers.docusign.com/esign-rest-api/guides/features/templates for information about this.
You can make a GET call (GET /v2.1/accounts/{accountId}/templates/{templateId}) to the template API and the top of the json you get back would look like this:
{
"emailSubject": "DocuSign API - Composite Templates",
"emailBlurb": "Composite Templates Sample 1",
"status": "sent",
(just cut the rest of the json)
where you can find what you need

Outlook REST API to extract URLs in the message body

Is there an Outlook REST API that gives me all the urls extracted from the body of the message? Some thing like what EWS's EntityExtractionResult does?
No there isn't. However, you can retrieve extended properties, so you should be able to request the PidNameExtractedUrls property.
If you dig through those open specs, you should find these details on PidNameExtractedUrls:
Property set: PSETID_XmlExtractedEntities {23239608-685D-4732-9C55-4C95CB4E8E33}
Property name: XmlExtractedUrls
So that would mean I could make the following request (assuming you're using the Outlook endpoint, not Graph):
GET https://outlook.office.com/api/v2.0/me/messages?$expand=SingleValueExtendedProperties($filter=PropertyId eq 'String {23239608-685D-4732-9C55-4C95CB4E8E33} Name XmlExtractedUrls')
For Graph, you would replace PropertyId with id.
That will include something like this in the message entities that have this property set:
"SingleValueExtendedProperties": [
{
"PropertyId": "String {23239608-685d-4732-9c55-4c95cb4e8e33} Name XmlExtractedUrls",
"Value": "<?xml version=\"1.0\" encoding=\"utf-16\"?><UrlSet><Version>15.0.0.0</Version><Urls><Url StartIndex=\"0\"><UrlString>https://www.google.com</UrlString></Url><Url StartIndex=\"23\"><UrlString>https://developer.microsoft.com/outlook</UrlString></Url></Urls></UrlSet>"
}
]

Is there a way to search inside a message using Gmail API?

I have thousands of email. I need to search whether any of the message contains the text "Hello world" or any other regular expression. How can I achieve this using Gmail API?
The Users.messages: list-request supports a custom query parameter that you can use. This parameter works just the same as the search input field in the regular Gmail Client.
q = Hello world
GET https://www.googleapis.com/gmail/v1/users/me/messages?q=Hello+world
Response:
{
"messages": [
{
"id": "14f9826d5e0811ee",
"threadId": "14f9826d5e0811ee"
}
],
"resultSizeEstimate": 1
}

Resources