DocuSignAPI - Sign an envelope via API - postman

We are creating an application that processes signed documents. As part of the testing process, I'd like to automate the creation and signing of sample documents. How can I sign the documents via postman?
Using the Postman scripts located at the DocuSign/blog, I can authenticate:
https://{{hostenv}}/restapi/{{apiVersion}}/login_information?api_password=true
{
"loginAccounts": [
{
"name": "Personal",
"accountId": "9",
"baseUrl": "https://demo.docusign.net/restapi/v2.1/accounts/9",
"isDefault": "true",
"userName": "Chris",
"userId": "",
"email": "",
"siteDescription": ""
}
],
"apiPassword": "="
}
and then create an envelope to be signed...
{{baseUrl}}/envelopes
{
"recipients": {
"signers": [
{
"email": "{{signer1Email}}",
"name": "{{signer1Name}}",
"recipientId": 1,
"tabs": {
"signHereTabs": [
{
"xPosition": "100",
"yPosition": "100",
"documentId": "1",
"pageNumber": "1"
}
]
}
}
]
},
"emailSubject": "DocuSign API - Signature Request on Document Call",
"documents": [
{
"documentId": "1",
"name": "blank1.pdf",
"documentBase64": "JVBERi0x..."
}
],
"status": "sent"
}
Is there a way - via postman - to sign the envelope that was just created?
I've been exploring a more involved setup (Selenium, etc) but was wondering if documents can be signed via postman.

As Inbar states, you can't automatically sign an envelope using the DocuSign API. One alternative is to Correct the envelope to change the Signer to a Carbon Copy recipient, which would immediately complete their role in the envelope.

You cannot sign envelopes via the REST API (or any other API).
You can use UI automation techniques to click things on the page and sign envelopes this way.
there's a similar question that was asked here, it has an answer from an automation expert who did this - DocuSign integration tests

Related

Callback url value in email for verifying account

This is an extension of Unable to validate account confirmation in WSO2 version 6.0 issue.
I have same regex pattern in my self-registration section. But when I'm creating users using rest API, the link which I got in the email is
https://localhost:9443/accountrecoveryendpoint/confirmregistration.do?confirmation=ce790759-1086-4870-a673-35b5927351d8&userstoredomain=PRIMARY&username=samyu&tenantdomain=carbon.super&callback={{callback}}
and when I created the user using manually the link which I got is
https://localhost:9443/accountrecoveryendpoint/confirmregistration.do?confirmation=dff024e7-d7e7-48ef-bb60-1c1c4d6f3b1c&userstoredomain=PRIMARY&username=sam&tenantdomain=carbon.super&callback=https%3A%2F%2Flocalhost%3A9443%2Fmyaccount.
So, the difference between these two links is that callback. So what configuration should I make in order to get the callback value
When you are trying this from the recovery portal, the callback value is set automatically. If you are trying with the REST API you need to include that in the request. The following is a sample JSON payload.
{
"user": {
"username": "kim",
"realm": "PRIMARY",
"password": "Password12!",
"claims": [
{
"uri": "http://wso2.org/claims/givenname",
"value": "kim"
},
{
"uri": "http://wso2.org/claims/emailaddress",
"value": "kimAndie#gmail.com"
},
{
"uri": "http://wso2.org/claims/lastname",
"value": "Anderson"
},
{
"uri": "http://wso2.org/claims/mobile",
"value": "+947729465558"
}
]
},
"properties": [
{
"key": "callback",
"value": "https://localhost:9443/myaccount"
}
]
}
Notice the way how you need to send the callback when using the REST API.

GCP DialogFlow CX - returning choice list / buttons in webhook response fulfillment_response or using parameters in custom payload to provide choices

I have created a chatbot in DialogFlow CX. After a customer identifies themselves, a call is made to the webhook (written in Python) which finds the 3 closest retail stores to the customer, and returns those in the webhook response as parameters:
bot_response = {
"fulfillment_response":
{
"messages": [
{
"text": {
"text": [
f'Thanks {first_name}! I\'ve located your account.'
]
}
}
]
},
"session_info": {
"session": session_name,
"parameters": {
"first_name": first_name,
"email_address": email_address,
"business_partner_id": business_partner_id,
"address_line_1": c['response']['address_line_1'],
"address_line_2": c['response']['address_line_2'],
"suburb": c['response']['suburb'],
"postcode": c['response']['postcode'],
"region": c['response']['state'],
"store_1": locations[0].store_name,
"store_1_id": locations[0].store_id,
"store_1_address": locations[0].address,
"store_2": locations[1].store_name,
"store_2_id": locations[1].store_id,
"store_2_address": locations[1].address,
"store_3": locations[2].store_name,
"store_3_id": locations[2].store_id,
"store_3_address": locations[2].address
}
}
}
My intention is to allow the customer to select 1 of these 3 store locations. In the above model, I've returned them as parameters, which are successfully recorded in dialogflow, however I am stuck on how to provide these values as a list of options to the customer. I am unsure whether I can
a) Provide a list of options back to the user as a Webhook Response (instead of parameters). All documentation I can find suggests only that text and parameters can be returned.
Or
b) Use the returned parameters to create a custom payload to present them as a list for the user to select from. Something like:
{
"richContent": [
[
{
"event": {
"name": "Store1",
"parameters": {},
"languageCode": ""
},
"subtitle": "${store_1_id}",
"title": "${store_1_address}",
"type": "list"
}
]
]
}
But I cannot find any documentation to suggest you can embed parameters into custom payloads.
Does anyone know of a way to solve this situation? Thank you!
As per usual, the mere act of posting a question on Stack Overflow somehow creates a higher statistical likelihood that I will in fact answer my own question. It's simple enough to add it to a custom payload to present in a list, simply using the syntax:
{
"richContent": [
[
{
"event": {
"name": "Store1",
"parameters": {},
"languageCode": ""
},
"subtitle": "$session.params.store_1_address",
"title": "Store 1",
"type": "list"
}
]
]
}

Delete record Libcloud (GoDaddy api)

I try to implement delete method for Record delate-record, but its my first time to use python and this api.
The GoDaddy API doesn't have a delete record method, so this functionality is not exposed in the driver.
https://developer.godaddy.com/doc#!/_v1_domains/recordReplace
The driver could offer the 'replace records in zone' method, which would allow you to fetch the current list of records, and then set the new list minus the record you want to remove. But that feature is not implemented and quite risky.
First,
Send a GET request to https://api.godaddy.com/v1/domains/{DOMAIN}/records
Then, Enumerate over all records of API Response (JSON Array) and prepare new data by removing the one that needs to be deleted.
API Response (SAMPLE)
[
{
"data": "192.168.1.1",
"name": "#",
"ttl": 600,
"type": "A"
},
{
"data": "ns1.example.com",
"name": "#",
"ttl": 3600,
"type": "NS"
},
{
"data": "#",
"name": "www",
"ttl": 3600,
"type": "CNAME"
},
{
"data": "mail.example.com",
"name": "#",
"ttl": 3600,
"priority": 1,
"type": "MX"
}
]
New Data (After deleting record) (SAMPLE)
[
{
"data": "192.168.1.1",
"name": "#",
"ttl": 600,
"type": "A"
},
{
"data": "ns1.example.com",
"name": "#",
"ttl": 3600,
"type": "NS"
},
{
"data": "#",
"name": "www",
"ttl": 3600,
"type": "CNAME"
}
]
Now,
Send a PUT request to https://api.godaddy.com/v1/domains/{DOMAIN}/records with new data.
The most important thing is how you identify the records in above array which needs to be deleted. This would not be a difficult task, assuming you have good programming skills.
I managed to worked around it in kind of a hacky - we had bunch of records we wanted to delete, doing it manually seemed weird so I added a Javascript into the Chrome Developer Console, running on an authenticated session from the DNS manage page:
function deleteGoDaddyRecords(recordId) {
$.ajax({
url: 'https://dcc.godaddy.com/api/v3/domains/<YOUR-DOMAIN.com>/records?recordId='+recordId,
type: 'DELETE',
success: function(result) {
console.log(result)
}
});
}
which let me use the same call the UI is calling when you ask to delete a record.
the only thing you need to provide is the AttributeUid which is not available with the public API, but it is in the front-end API:
https://dcc.godaddy.com/api/v2/domains/runahr.com/records
So I managed to create a script that will generate bunch of
deleteGoDaddyRecords('<RECORD-UUID>');
deleteGoDaddyRecords('<RECORD-UUID>');
copy & paste the generated script into the Developers Console and that solved it for now.
I hope GoDaddy will add a public DELETE endpoint to their API in the future :)

How can we get the phone number with Google OAuth API and facebook API used for social login?

How can we get the phone number with Google OAuth API login.
I am using scopes as
'scope' : 'https://mail.google.com https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/plus.login '
and the request is as
var request = gapi.client.plus.people.get({'userId': 'me'});
Is there any scope we can use to get it.
I am getting response as with no sight of phone number :
{
"kind": "plus#person",
"etag": "\"vPymIyv1bT9LfmoUujkgN2yLMK0\"",
"gender": "male",
"emails": [
{
"value": "XXX#gmail.com",
"type": "account"
}
],
"urls": [
{
"value": "http://picasaweb.google.com/XXX",
"type": "otherProfile",
"label": "Picasa Web Albums"
}
],
"objectType": "person",
"id": "4354354334435465",
"displayName": "XXXXX YYYY",
"name": {
"familyName": "XXX",
"givenName": "YYYYY"
},
"url": "https://plus.google.com/1100335464643327",
"image": {
"url": "https://lh3.googleusercontent.com/-fgsdgfgU9-jU/AAAAAAAAAAI/AAAAAAAADkM/fgffdgdkM/photo.jpg?sz=50",
"isDefault": false
},
"isPlusUser": true,
"language": "en",
"ageRange": {
"min": 21
},
"circledByCount": 59,
"verified": false
}
if you want to get user phone numbers you have to have authorization from the user: see the following info page : https://developers.google.com/admin-sdk/directory/v1/guides/authorizing
ask the user for this scope of authorization :
https://www.googleapis.com/auth/admin.directory.user.readonly
after you have authorization from user run the folowing request :
GET https://www.googleapis.com/admin/directory/v1/users/userKey
the response will be a JSON response formatted as followed:
https://developers.google.com/admin-sdk/directory/v1/reference/users#resource
one of the attributes is phone list.
hope it helps.
You can use google's people API to get the user's phone numbers.
To explore more you can try yourself.
Steps to explore:
Visit this link.
Select https://www.googleapis.com/auth/user.phonenumbers.read permission in People API v1 section
Click on Authorize API
Choose the account to log in
Grant permission
Click Exchange authorization code for tokens
Enter https://people.googleapis.com/v1/people/138262720636785143353?personFields=phoneNumbers,emailAddresses link, make sure you replace the UID
Click on send request to see the response

Facebook graph API obtain a specific users's pictures from that same user

I'm working on an Android application and I'm trying to obtain contact pictures from friends. I'm still testing the graph request on the Facebook Graph API Explorer linkhere I'm going to use afterwards in the code, and I've hit a snag...
After generating an Access Token, and validating it allows me access to the correct fields I'm interested, I'm trying to filter the information I'm obtaining from Facebook.
Using the Facebook Graph API Explorer I'm performing the following request:
< USER_ID>?fields=id,first_name,last_name,location,picture,birthday,photos.limit(3).fields(id,picture,source,from)
I obtain, as expected:
{
"id": "<USER_ID>",
"first_name": "<FIRST>",
"last_name": "<LAST>",
"photos": {
"data": [
{
"id": "<PICTURE1>",
"source": "<PIC1.jpg>",
"from": {
"name": "<OTHER_USER1>",
"id": "<OTHER_USER1_ID>"
},
"created_time": "2013-08-17T11:39:19+0000"
},
{
"id": "<PICTURE2>",
"source": "<PIC2.jpg>",
"from": {
"name": "<OTHER_USER2>",
"id": "<OTHER_USER2_ID>"
},
"created_time": "2013-08-04T14:27:07+0000"
},
{
**"id": "<PICTURE3>"**,
"source": "<PIC3.jpg>",
"from": {
"name": "<USER>",
**"id": "<USER_ID>"**
},
"created_time": "2013-08-03T17:35:20+0000"
}
],
"paging": {
"previous": "<LINK1>",
"next": "<LINK2>"
}
},
"picture": {
"data": {
"url": "<PIC>",
"is_silhouette": false
}
}
}
What I would like is to only obtain the pictures from ... like the third picture or others, is this possible using the graph api?
Thanks for the help.
Marc
PS:
I've tried adding in the end something like &photos.data.from.id=< USER_ID>
but I till get the same data set in response.
I would like to avoid requesting more pictures and filter it programmatically, because You never know how many pictures are associated with a user that where not submitted by that user.
Not possible with the Graph API, but you can use FQL, to query for the photos of the user (not those in which he's tagged in) -
SELECT pid,src FROM photo WHERE owner = me()
Check FQL - Photo to include the required fields in the result.