In my application, after user register, it creates a docusign document and send in an envelope to user's email for signature.
My question is how do I also provide a link to the document from my application? I want it to be the same link that user would access in their email. I have tried to construct url from envelope_id which i get from the result of create_envelope, but that seems to be wrong. Is there actually a way to do this? Or the it has to be accessed from user's email?
An envelope uri: envelopes/ids
The flow you might be looking for is called Embedded Signing. With embedded signing, you can redirect your users to sign DocuSign envelopes instead of having them sign via email.
Two steps process:
First, you will create your envelope. Be sure to include clientUserId for each recipient object. This will be used when you want to generate unique signing URLs in the next step.
POST /accounts/{accountId}/envelopes
{
"status": "sent",
"emailSubject": "Envelope with Embedded Signer",
"documents": [{
"documentId": "1",
"name": "contract.pdf",
"documentBase64": "base64 document bytes...",
}],
"recipients": {
"signers": [{
"email": "john#email.com",
"name": "John Doe",
"recipientId": "1",
"clientUserId": "1234"
}]
}
}
Second, you will generate the RecipientViewURL for a given user.
POST /accounts/{accountId}/envelopes/{envelopeId}/views/recipient
{
"userName": "John Doe",
"email": "johndoe#email.com",
"recipientId": "1",
"clientUserId": "1234",
"authenticationMethod": "email",
"returnUrl": "https://www.docusign.com/devcenter"
}
Here is a guide that provides a more thorough background on the feature.
Related
I'm on exploration Dataplex API with Python in Google Documentation, there is documentation to Get Lake, Zone, Assets, etc. I've explored that documentation, but I didn't find any documentation related to Tag Policies, for example, I need to attach my Tag Template and add Policy Tag to my BigQuery Table via API.
Is it possible to attach Tag Template and add Policy Tag into BigQuery Table via API?
Here is the link that I've explored:
Dataplex API Service
Dataplex API Metadata Service
Data Catalog API
for attaching tag templates to BigQuery table, first you will have to lookup the entry in dataplex using api
https://cloud.google.com/python/docs/reference/datacatalog/latest/google.cloud.datacatalog_v1.types.LookupEntryRequest
and then attach is to table using api
https://cloud.google.com/python/docs/reference/datacatalog/latest/google.cloud.datacatalog_v1.types.CreateTagRequest
here's sample code, this creates tag template and also attaches it to table in same code base
https://cloud.google.com/data-catalog/docs/samples/data-catalog-quickstart
and to attach policy, use this api
https://cloud.google.com/python/docs/reference/datacatalog/latest/google.cloud.datacatalog_v1.types.CreatePolicyTagRequest
hope this helps
again.
To simulate the pythonic api's behaviour, I used google cloud api explorer to explain in detail. see below.
The entry lookup is to search for object(s) you want to attach a tag/tag templates
Basically here's how I simulated the api calls using api explorer
To attach a tag to a BigQuery table, first step is to search the table up using Datacatalog api url below
LookupEntryRequest
The parameters I passed to get below response is
sqlResource: "bigquery.table.myproject.zz_DataSet.tblOne"
Above should give you output as
{
"name": "projects/myproject/locations/australia-southeast2/entryGroups/#bigquery/entries/mykey",
"type": "TABLE",
"schema": {
"columns": [
{
"type": "STRING",
"mode": "NULLABLE",
"column": "firstname"
},
{
"type": "STRING",
"mode": "NULLABLE",
"column": "lastname"
}
]
},
"sourceSystemTimestamps": {
"createTime": "2023-01-16T04:22:49.397Z",
"updateTime": "2023-01-16T04:22:49.397Z"
},
"linkedResource": "//bigquery.googleapis.com/projects/myproject/datasets/zz_DataSet/tables/tblOne",
"bigqueryTableSpec": {
"tableSourceType": "BIGQUERY_TABLE"
},
"usageSignal": {
"updateTime": "2023-02-05T07:59:59.928Z",
"usageWithinTimeRange": {
"30D": {
"totalCompletions": 7,
"totalFailures": 1,
"totalExecutionTimeForCompletionsMillis": 7385
}
}
},
"integratedSystem": "BIGQUERY",
"fullyQualifiedName": "bigquery:myproject.zz_DataSet.tblOne"
}
The search gives you ability to query multiple tables or attach tags at Dataset level too, see parameters section on link above.
This is why I suggest you use entry look up first as its more scalable code.
API Call two: This is how i simulated the attach tag to resource. If you go to link below
CreateTagRequest
As an example: I pre created an tag template from console and then used the template-id value to pass as a parameter to the request
Input:
parent: projects/myproject/locations/australia-southeast2/entryGroups/#bigquery/entries/mykey from above name element
request body:
{
"template": "projects/myproject/locations/australia-southeast1/tagTemplates/api_call_test_tag_template",
"fields": {
"name": {
"stringValue": "apitestcall"
}
}
}
Output:
Below is the response generated and if you see in data catalog console, you will see bigquery table with the tag template attached to it with value to name field as "apitestcall" attached to it. see image attached
{
"name": "projects/myproject/locations/australia-southeast2/entryGroups/#bigquery/entries/mykey/tags/tagsKey",
"template": "projects/myproject/locations/australia-southeast1/tagTemplates/api_call_test_tag_template",
"fields": {
"name": {
"displayName": "name",
"stringValue": "apitestcall"
}
},
"templateDisplayName": "api-call-test-tag-template"
}
Finally, please do make sure you have all the correct IAM permissions required for this task.
I use docusign every day and have set up a google sheet that auto populates the email subject and body.
I'm still having to copy and paste this data into the 'email subject' & 'email message'. See screenshot example.
Is there a way i can reduce this process to the click of a button?
Absolutely. Here's are two rough flows that would be helpful to pursue.
You could make use of the Google Apps Script to push data directly to DocuSign. Downside here is that you'd be writing the code in JavaScript.
You can write a short python app yourself, which uses the Google Sheets API (via python sdk) to retrieve your data, then pass along the appropriate info to the DocuSign eSignature API (via python sdk).
In either case, once you have access to the data you wish to forward to DocuSign, you will want to first authenticate your account to make API requests on your behalf.
Then you can make a request like this:
POST /envelopes
{
"emailSubject": "Please sign these documents",
"emailBlurb": "Thank you for subscribing. Click the link to sign",
"documents": [
{
"documentBase64": "JVBER...iUlRU9GCg==",
"name": "Test Doc",
"fileExtension": "pdf",
"documentId": "1"
}
],
"recipients": {
"signers": [
{
"email": "test#test.com",
"name": "Test User",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"numberTabs": [
{
"tabLabel": "PO #",
"locked": "false",
"xPosition": "200",
"yPosition": "200",
"documentId": "1",
"pageNumber": "1"
}
]
}
}
]
},
"status": "sent"
}
Our Django app uses SparkPost as an email provider. A new feature we are implementing should allow users to create their own organizational emails and send them to whoever they wish. Now, these emails should be received as individual ones, not with multiple recipients ("to") so that users can't see each other's address.
I have run a few tests with the SparkPost transmissions API. This is how you send an email:
sp = SparkPost(API_KEY)
response = sp.transmissions.send(recipients=emails, html=body, from_email=sender, subject=self.subject)
Where emails is a list of string literals.
In all test cases except one I did get individual emails with a single recipient just as I was after. But in one case the email had multiple "to" emails, and you could see each other's email address. I changed absolutely nothing in the code, this just happened.
Is there any way I could do that other than sending an individual transmission for each recipient? I'm worried about performance if it comes to that:
sp = SparkPost(API_KEY)
for email in emails:
sp.transmissions.send(recipients=email, html=body, from_email=sender, subject=self.subject)
Yes, it is best to do this in a single REST call.
By default, SparkPost REST injections are BCC and will send individual emails to each recipient. As you have seen you can also have the typical "CC" behavior but you would need to set the CC header values with the addresses you want to be seen by others.
So in the example where a CC was included you must have had something like this in the REST call:
"headers": {
"CC": "cc#thatperson.com"
},
CC Example:
{
"recipients": [
{
"address": {
"email": "to#thisperson.com"
}
},
{
"address": {
"email": "cc#thatperson.com",
"header_to": "to#thisperson.com"
}
}
],
"content": {
"from": "you#fromyou.com",
"headers": {
"CC": "cc#thatperson.com"
},
"subject": "To and CC",
"text": "This mail was sent to to#thisperson.com while CCing cc#thatperson.com."
}
}
BCC Example:
"recipients": [
{
"address": {
"email": "to#thisperson.com"
}
},
{
"address": {
"email": "bcc#thatperson.com",
"header_to": "to#thisperson.com"
}
}
],
"content": {
"from": "you#fromyou.com"
"subject": "To and BCC",
"text": "This mail was sent To to#thisperson.com while BCCing an unnamed recipient. Sneaky."
}
}
In your usecase you would not want to set "header_to": "to#thisperson.com" for any of the recipients.
I followed this tutorial for the authentification with google account in the flask.
As was written in this tutorial the response as the JSON is:
{
"family_name": "Doe",
"name": "John Doe",
"picture": "https://lh3.googleusercontent.com/-asdasdas/asdasdad/asdasd/daadsas/photo.jpg",
"locale": "en",
"gender": "male",
"email": "john#gmail.com",
"link": "https://plus.google.com/+JohnDoe",
"given_name": "John",
"id": "1109367330250025112153346",
"verified_email": true
}
I fetch this JSON response to my database and trying to login in offline mode. In other words, I added one more "group" column to the response and base that column redirect users to the different pages. When I try to log in again with this credentials after login page it opens a blank page without any error. My question how can I keep google user credentials in the flask at offline mode. Thank you for reading
You can't keep it by this way because oath token will update each time. But you can update user data, at the base of the email. Read this guide
I'm using the paypal-python-sdk.
Currently, I'm redirecting the user to paypal where they log in, click confirm, and are redirected back to my site. No issues there. However, I have no idea how to get the authorization id so I can capture the amount authorized (or smaller). According to the docs its supposed to exist under related_resources but the list is always empty.
Will authorizations completed by logging into paypal return an authorization id?
Clarification: I know I can execute the payment with the payment_id. However, executing the payment is out of the question because I must be able to capture less than authorized.
request = {
"intent": "authorize",
"redirect_urls": {
"return_url": PAYPAL_RETURN_URL,
"cancel_url": PAYPAL_CANCEL_URL
},
"payer": {
"payment_method": "paypal"
},
"transactions": [{
"amount": {
"total": str(self.order.total),
"currency": "USD"
},
"description": "Lorem lipsum"
}]
}
payment = Payment(request, api=self._connection())