How to attach file to email using REST API - acumatica

I am working with emails from REST API.
I am able to create the email in the system and to update it.
The problem is with attaching files to the email to correct the images in the body of the email.
The endpoint for attaching files to records looks like below:
http://<Base endpoint URL>/<Top-level entity>/<Key value 1>/<Key value 2>/files/<File name>
The problem with emails is that the Key for emails is the NoteID field which can be accessed only using $custom parameter with requests like below:
https://baseurl/18.200.001/Email?$filter=From eq 'test#email.com'&$custom=Message.NoteID
This request will return a response like below
[
{
"id": "50bd83f1-b5bb-49f2-8ca9-6e55d6e10463",
"rowNumber": 1,
"note": "",
...
...
...
"custom": {
"Message": {
"NoteID": {
"type": "CustomGuidField",
"value": "9daca267-4bbd-e911-81ee-0259459e71e6"
}
}
},
"files": []
}
]
Where the NoteID corresponds to the one shown in the browser URL for the email
The problem is that when I try to send a request for attaching a file to that email using that NoteID or id from the response I always receive 'No entity satisfies the condition." error message in the request profiler.
Is there any other way to attach files using REST API?

After reviewing the OpenAPI 2.0 specification, comparing the specification for attaching files to different entities and checking keys of the entities it turned out that the Key of the entity must be specified in the Web Service Endpoint.
In the case of Email entity, the key field is NoteID and it is not specified in the endpoint, even more, it is not being shown in the lookup of the fields in the Web Service Endpoint.
But luckily, the system is allowing to manually write NoteID in the grid and save the endpoint like below:
and this entity is even passing the validation

Related

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.

TemplateRoles Adding, not replacing signer

Left Column 'Get' recipients, Right Col 'Post' envelopes
The problem is Instead of Replacing the Client as I expected based on docs.
It Added a second signer to the process. My template was set up for two roles Advisor and Client. I excpected the client to ONLY be the one I passed via the api. Instead it sent 3 emails total. One to Template Client, One to Template Advisor and one to Api Passed Client.
Unless I misunderstand the api function, It should not have sent an email to
original template Client.
When this happens, it usually means that the values you specified for the recipient in your "Create Envelope" API call did not exactly match the values that the template specified for the recipient role (i.e., roleName, etc.).
To resolve this issue, I'd suggest that you issue a "Get Recipients" call for your template (GET /v2/accounts/{accountId}/templates/{templateId}/recipients) to identify the exact values that the template defines for the "Client" recipient role, and then ensure that your "Create Envelope" API request specifies the same exact values (including case) for the recipient that you want to occupy the "Client" role. If you try this and still can't figure it out, then please update your question with your "Create Envelope" request and the results of the "Get Recipients" request, and someone here on SO will likely be able to spot your issue.
The template b521bece-6440-430a-9762-bf8d4543edc5 already has the recipient email/name filled.
Since recipients details are already filled, in the template, you will not be able to substitute the values during envelope creation.
You can modify the template and leave the name and email fields empty.
Then Create the envelope with just a single recipient. The notifications will only be sent to the single recipient.
POST /v2/accounts/{accountId}/envelopes
{
"status": "sent",
"templateId": "b521bece-6440-430a-9762-bf8d4543edc5",
"templateRoles": [
{
"email": "mike#acme.com",
"name": "Mike TestName",
"roleName": "Client"
}
]
}

Add flag if description field is not empty

If you add any information to the description field of a google calendar (web) entry, it would be very useful to see a flag/mark/asterisk in the subject line. Then you can easily scroll through your event list or overview without double-clicking all records for (non-existent) details.
Is there an addon/plugin that will do this for me? Or do I have to program a chrome extension?
You can use Calendars:get by using this request, you were able to detect if the description of the calendar is empty or not.
Here's a sample request:
HTTP request
GET https://www.googleapis.com/calendar/v3/calendars/calendarId
Use calendarId to retrieve calendar IDs, call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the primary keyword.
Note that every request, your application sends to the Google Calendar API. Your request must include an authorization token. The token also identifies your application to Google. Your application must use OAuth 2.0 to authorize requests.
Successful Response include description as string:
{
"kind": "calendar#calendar",
"etag": etag,
"id": string,
"summary": string,
"description": string,
"location": string,
"timeZone": string
}

Using the docusign api c# access code for authentication of signer

Using the sample C# send document API call, how can I send a data element located in my system, such as zip code or last 4 of ssn, to be enable this as an access code to view the document? This way I know that the person signing has another level of authentication tat ties back to the signer.
Have you read through the DocuSign API documentation yet? Just add the accessCode property to your signer JSON object and give it a value. Basically, something like this:
"recipients":
{
"signers": [
{
"email": "test_1#email.com",
"name": "Name 1",
"accessCode": "1234",
...
Description from API docs:
"This Optional element specifies the access code a recipient has to enter to validate their identity. This can be a maximum of 50 characters."

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