Embedded and Remoting DocuSign process - c#

I am working on a task where there are list of 3 people who needs to sign the document one after the other. The very first persons DocuSign the document through the application i.e. its an embedded DocuSign. While the other 2 does remote DocuSign.
I am able to achieve the embedded signing but could not figure out how to achieve the remote signing. Since the envelopeID is same. Even if I add recipients to the envelope the remote DocuSign email is not triggered.
Can anyone help me on how to go about on this?

I would need to see your request body to see how you are adding your recipients, but my guess is that you are setting the latter 2 as embedded also.
To make a recipient an embedded one you need to set the clientUserId property for them, in addition to the other expected info (i.e. email, name, etc). If you do NOT want the recipient to be an embedded one, simply do not set the clientUserId property for them.
For instance, the following (partial) JSON would set the first recipient as an Embedded one and the 2nd and 3rd recipients as remote, meaning will get an email notification to to sign:
"recipients": {
"signers": [
{
"routingOrder": "1",
"recipientId": "1",
"clientUserId": "1000",
"name": "Sally Doe",
"email": "test_1#email.com"
},
{
"routingOrder": "2",
"recipientId": "2",
"name": "John Doe",
"email": "test_2#email.com"
},
{
"routingOrder": "3",
"recipientId": "3",
"name": "Jonny Moe",
"email": "test_3#email.com"
}
]
}
For more information please see the Explore -> Features -> Embedding page on the DocuSign Developer Center:
https://www.docusign.com/developer-center/explore/features/embedding-docusign

Related

Docusign Resend with REST

So there is another ticket here (closed) that talks about how to do this. However, something must have changed since that ticket was answered.
I followed the very sparse documentation at DocuSign, and keep getting stuck.
I followed another ticket here exactly, and I'm still getting an error that I can't resolve. I do have dozens of different types of calls working perfectly, this is the only call (so far) that I have tried that I can't get to work.
I have a recipient that lost their email. I need to resend to them. No changes to the document are necessary.
I do a 'PUT' to the following URL:
https://na4.docusign.net/restapi/v2/accounts/{Redacted}/envelopes/{Redacted}/recipients?resend_envelope=true
In the body, I pass the object 'DocuSign.eSign.Model.Recipients'
There is 1 recipient, the one who lost the email. (again, status is 'sent', I checked manually to be sure). I included it below for sake of documentation.
I get the following error. I cannot get past this. The error sounds obvious. It sounds like the recipient document is in a status that cannot be resent, but that's simply not the case. I've verified the status, I've verified that account # is correct, I've verified that document id and recipient id are correct. Just not sure what else I can check.
I just need to resend this, and this call should be the right call. According to the documentation, 'PUT' is the correct verb.
{
"recipientUpdateResults": [
{
"recipientId": "1",
"errorDetails": {
"errorCode": "RECIPIENT_UPDATE_FAILED",
"message": "The recipient could not be updated.
Recipient not in state that allows correction."
}
}
]
}
Body of document that is being sent. I've tried both with emailBody & emailSubject NULL, or the original values. Neither way works.
{
"signers": [
{
"email": "{Redacted}",
"emailNotification": {
"emailBody": "{Redacted}",
"emailSubject": "{Redacted}"
},
"name": "{Redacted}",
"recipientId": "1",
"tabs": {
"dateSignedTabs": [
{
"documentId": "1",
"pageNumber": "1",
"recipientId": "1",
"xPosition": "60",
"yPosition": "757"
}
],
"signHereTabs": [
{
"documentId": "1",
"pageNumber": "1",
"recipientId": "1",
"xPosition": "50",
"yPosition": "652"
}
]
}
}
]
}
If the envelope was already sent, meaning it's not longer in "draft" status you cannot simply modify it anymore.
Envelopes can be modified at will only when they are in "draft" state and if your envelope was in that state - you wouldn't get this error.
Once the envelope was sent ("sent" state) you need to use special Correct action for any changes. That can be initiated by putting envelope into correct state and potentially giving user the correct view where they can add/remove recipients and tags.
Update: If you are just trying to resend the envelope, make sure the JSON body of your request is empty ({}). Empty object in C# will do the trick...
Update 2: Need to use REST API v2.1 and not v2.0.

Using the x-user-id in the c# forge package within the 2legged context

We are trying to create a simple integration for a Forge App with BIM360, we have done loads of stuff using the 3 legged contexts but now we are trying to expose (some functionality) to users without the need for them to explicitly log into their Autodesk account.
All very exciting stuff!
We are making the following call within a 2 legged context as per the documentation (apiReferenc: https://forge.autodesk.com/en/docs/data/v2/reference/http/hubs-hub_id-projects-GET/#headers , C# reference: https://github.com/Autodesk-Forge/forge-api-dotnet-client/blob/master/docs/ProjectsApi.md#gethubprojects) and would like to add the x-user-id to this call
var api = await factory.CreateProjectsApiAsync(TwoLeggedToken);
var apiResult = await api.GetHubProjectsAsync(hubId);
The x-user-id is instrumental in filtering so the users are only able to see and access the hubs/projects they are added to.
We, however, can't find how to implement this x-user-id in the c# forge package. The different c# forge package API's configuration have Username, UserAgent but no user id or similar properties. We also can't seem to find the type of user id the x-user-id header expects. Is this the full name of an Autodesk account (ex: "Samuel Middendorp"), the username specified in the Autodesk account settings. s.middendorpXXXX or the user id specified when looking at forge calls responses (for example createUserId).
I hope any of you fine people at Autodesk could help me out here!
I would also like to Thank Bryan Huang for quickly answering our previous questions about missing typings and more and helping us get to this point in development!
Thank you for reporting. I have created an issue on our forge-api-dotnet-client repository to our team to allocate time to add this support, please see:
https://github.com/Autodesk-Forge/forge-api-dotnet-client/issues/63
In reference to your question about which id the x-user-id header requires, it is the uid.
If you have a two-legged token, you can retrieve this by searching for a user by email with the BIM 360 API users/search endpoint:
https://developer.api.autodesk.com/hq/v1/accounts/:hubId/users/search?email=:userEmail
Here's a sample response:
[
{
"id": "579d4408-39a4-4b3a-9474-6e781e68ab94",
"account_id": "9dbb160e-b904-458b-bc5c-ed184687592d",
"status": "pending",
"role": "account_admin",
"company_id": "14e95a5e-02eb-49aa-a39a-447d90544873",
"company_name": "Autodesk",
"email": "john.smith#mail.com",
"name": "John Smith",
"nickname": "Johnny",
"first_name": "John",
"last_name": "Smith",
"uid": "L9EBJKCGCXBB", // This is the one you want
"image_url": "http://static-dc.autodesk.net/etc/designs/v201412151200/autodesk/adsk-design/images/autodesk_header_logo_140x23.png",
"last_sign_in": null,
"address_line_1": "The Fifth Avenue",
"address_line_2": "#301",
"city": "New York",
"postal_code": "10011",
"state_or_province": "New York",
"country": "United States",
"phone": "(634)329-2353",
"company": "Autodesk",
"job_title": "Software Developer",
"industry": "IT",
"about_me": "Nothing here",
"created_at": "2015-04-29T06:59:05.582Z",
"updated_at": "2015-04-29T06:59:05.582Z"
}
]

How to not default DocuSign initial with signature?

How do I generate a blank "Initial" when sending someone to DocuSign to sign a document? It is currently generating the initials based upon the name of the signer, but the problem is that the signer might have PHD or something added to the end of their name. Thanks!
There's an account setting called SignInEachLocation that might be what you are after. Normally the DocuSign platform gives you the option to adopt one of the pre-generated signature and initial styles however if you don't want that and instead want your signers to sign and initial in each location you can enable this property on a per recipient basis.
Here is the description from the DocuSign API Docs:
signInEachLocation
When set to true and the feature is enabled in the sender's account, the signing recipient is required to draw signatures and initials at each signature/initial tab (instead of adopting a signature/initial style or only drawing a signature/initial once).
This property is configured on the individual signer objects in your envelope definitions, for example:
{
"status": "sent",
"emailSubject": "Request a signature via email example",
"documents": [{
"documentId": "1",
"name": "contract.pdf",
"documentBase64": "base64 encoded bytes..."
}],
"recipients": {
"signers": [{
"name": "John Doe",
"email": "john.doe#docusign.com",
"recipientId": "1",
--> "signInEachLocation": "true",
"tabs": {
"signHereTabs": [{
"xPosition": "25",
"yPosition": "50",
"documentId": "1",
"pageNumber": "1"
}]
}
}]
}
}

Outlook Rest API sending mail with attachments

I've written an application that automates the sending of mail from our system via a small console app that i've designed to run in azure as a webjob. The app sends mail perfectly fine until I attempt to add a collection of attatchments. Referring to https://msdn.microsoft.com/office/office365/APi/mail-rest-operations#Createandsendmessages
I've attempted to send their sample code for this with my Attatchments collection containing a single object that looks like this
{
"#odata.type": "#Microsoft.OutlookServices.FileAttachment",
"Name": "menu.txt",
"ContentBytes": "bWFjIGFuZCBjaGVlc2UgdG9kYXk="
}
However, after this api request was rejected with the error:
{"error":{"code":"RequestBodyRead","message":"The property 'ContentBytes' does not exist on type 'Microsoft.OutlookServices.Attachment'. Make sure to only use property names that are defined by the type."}}
And furthermore spending half an hour on the outlook services support line to fobbed off with go checkout some forums and to read the article I'd been using for reference since I started the project I've thrown in the towel. If anyone can assist me in getting this api to accept the request I'd be eternally thankful.
This is what a sample request looks like.
POST https://outlook.office.com/api/v2.0/me/sendmail
{
"Message": {
"Subject": "Meet for lunch?",
"Body": {
"ContentType": "Text",
"Content": "The new cafeteria is open."
},
"ToRecipients": [
{
"EmailAddress": {
"Address": "garthf#a830edad9050849NDA1.onmicrosoft.com"
}
}
],
"Attachments": [
{
"#odata.type": "#Microsoft.OutlookServices.FileAttachment",
"Name": "menu.txt",
"ContentBytes": "bWFjIGFuZCBjaGVlc2UgdG9kYXk="
}
]
},
"SaveToSentItems": "false"
}
And I'm aware that the message object has a bool flag of HasAttachments which when set to true does not affect the outcome of the call.
Based on the error message, you were using the ‘Microsoft.OutlookServices.Attachment’ intead of ‘Microsoft.OutlookServices.FileAttachment’.
I can reproduce this issue when I use the ‘Microsoft.OutlookServices.Attachment’ too.
And the sample above which use ‘Microsoft.OutlookServices.FileAttachment’ works well for me.
Please ensure that you were using the ‘Microsoft.OutlookServices.FileAttachment’ to send the text attachment.

How to get name, email, gender etc from Twitter using OAuth in MVC?

I'm using OAuth to connect my MVC application with twitter but I can't seem to get external data? Currently I'm using this:
AuthenticationResult result = OAuthWebSecurity.VerifyAuthentication(Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl }));
var extraData = result.ExtraData;
if (result.Provider == "facebook")
{
emailadres = extraData["username"];
}
else if (result.Provider == "twitter")
{
emailadres = extraData["username"];
}
Facebook does give me an email, but Twitter doesn't seem to do that...
Any solutions?
You can get name by querying following endpoint -
GET account/verify_credentials
It returns following response. But You cannot get Email or Gender (refer these threads from Twitter forums - No Email, No Gender) from this response.
{
"name": "Matt Harris",
"profile_sidebar_border_color": "C0DEED",
"profile_background_tile": false,
"profile_sidebar_fill_color": "DDEEF6",
"location": "San Francisco",
"profile_image_url": "http://a1.twimg.com/profile_images/554181350/matt_normal.jpg",
"created_at": "Sat Feb 17 20:49:54 +0000 2007",
"profile_link_color": "0084B4",
"favourites_count": 95,
"url": "http://themattharris.com",
"contributors_enabled": false,
"utc_offset": -28800,
"id": 777925,
"profile_use_background_image": true,
"profile_text_color": "333333",
"protected": false,
"followers_count": 1025,
"lang": "en",
"verified": false,
"profile_background_color": "C0DEED",
"geo_enabled": true,
"notifications": false,
"description": "Developer Advocate at Twitter. Also a hacker and British expat who is married to #cindyli and lives in San Francisco.",
"time_zone": "Tijuana",
"friends_count": 294,
"statuses_count": 2924,
"profile_background_image_url": "http://s.twimg.com/a/1276711174/images/themes/theme1/bg.png",
"status": {
"coordinates": {
"coordinates": [
-122.40075845,
37.78264991
],
"type": "Point"
},
"favorited": false,
"created_at": "Tue Jun 22 18:17:48 +0000 2010",
"truncated": false,
"text": "Going through and updating #twitterapi documentation",
"contributors": null,
"id": 16789004997,
"geo": {
"coordinates": [
37.78264991,
-122.40075845
],
"type": "Point"
},
"in_reply_to_user_id": null,
"place": null,
"source": "Twitter for iPhone",
"in_reply_to_screen_name": null,
"in_reply_to_status_id": null
},
"screen_name": "themattharris",
"following": false
}
EDIT
As mentioned by Davis in the comment, one can get email with new API modifications. But I am keeping this answer as is to support the integrity of question.
The API won't return an email address to you. If you're interested in a user's email address, you'll have to ask the user for it within your own application as a completely distinct act.
Not sure about gender, but you can get username and email.
See my answers here and here about getting gender.
I have used Twitter framework in my iOS App to get user details and email address. Twitter has provided a beautiful framework for that.
To get user email address, your application should be whitelisted. Here is the link. Go to use this form. You can either send mail to sdk-feedback#twitter.com with some details about your App like Consumer key, App Store link of an App, Link to privacy policy, Metadata, Instructions on how to log into our App etc..They will respond within 2-3 working days.
Here is the story how I got whitelisted by conversation with Twitter support team:
Send mail to sdk-feedback#twitter.com with some details about your App like Consumer key, App Store link of an App, Link to privacy policy, Metadata, Instructions on how to log into our App. Mention in mail that you want to access user email adress inside your App.
They will review your App and reply to you withing 2-3 business days.
Once they say that your App is whitelisted, update your App's settings in Twitter Developer portal. Sign in to apps.twitter.com and:
On the 'Settings' tab, add a terms of service and privacy policy URL
On the 'Permissions' tab, change your token's scope to request email. This option will only been seen, once your App gets whitelisted.
Hope it helps !!!
Requesting a user’s email address requires your application to be whitelisted by Twitter. To request access to a users email address, go here https://support.twitter.com/forms/platform
Once whitelisted, the “Request email addresses from users” checkbox will be available under your app permissions on apps.twitter.com. Privacy Policy URL and Terms of Service URL fields will also be available under settings which are required for email access. If enabled, users will be informed via the oauth/authorize dialog that your app can access their email address.

Categories

Resources