Trying to pre-fill text-tabs in Docusign via Rest API - php

I am having problems prefilling textTabs for my server templates in my docusign console. My application generates an agreement on our end and is added as a composite template along with another form that is added as a server template with a template id.
The server template has several fields the user needs to be able to fill out. The tabs have been defined and added with the manage template tool in the docusign console.
I have no problems sending the documents and the signHereTab is the only one that is correctly added to the form.
The two problems I have are 1) the fields the user should fill out are never shown on the recieved document, 2) the prefill information I am sending is not received by docusign. Below is the body request I am sending to the docusign REST API:
{
"emailSubject":"Nexogy Service Agreement Signature Request",
"emailBlurb":"Thank you for your interest in our services. Please sign the following agreement to continue with your service installation.",
"status":"sent",
"emailSettings":{
"replyEmailAddressOverride":"sales#nexogy.com",
"replyEmailNameOverride":"Nexogy",
"bccEmailAddresses":[
]
},
"eventNotification":{
"url":"https:\/\/dna.local.com\/documents\/set-status",
"loggingEnabled":true,
"requireAcknowledgment":true,
"useSoapInterface":false,
"includeDocuments":false,
"includeSenderAccountAsCustomField":true,
"envelopeEvents":[
{
"envelopeEventStatusCode":"Sent"
},
{
"envelopeEventStatusCode":"Delivered"
},
{
"envelopeEventStatusCode":"Signed"
},
{
"envelopeEventStatusCode":"Voided"
},
{
"envelopeEventStatusCode":"Declinded",
"includeDocuments":true
},
{
"envelopeEventStatusCode":"Completed",
"includeDocuments":true
}
]
},
"recipients":{
"signers":[
{
"email":"mmoreno509#gmail.com",
"name":"Test Tester",
"roleName":"Signer1",
"recipientId":718
}
]
},
"compositeTemplates":[
{
"inlineTemplates":[
{
"sequence":1,
"recipients":{
"signers":[
{
"email":"mmoreno509#gmail.com",
"name":"Test Tester",
"roleName":"Signer1",
"recipientId":718,
"tabs":{
"signHereTabs":[
{
"xPosition":100,
"yPosition":205,
"documentId":1,
"pageNumber":6,
"fontColor":"BrightBlue"
}
]
}
}
]
},
"documents":[
{
"documentId":1,
"name":"ChuyMPDFAgreement.pdf",
"remoteUrl":"https:\/\/s3.amazonaws.com\/dna_local\/ChuyMPDFAgreement.pdf"
}
]
}
]
},
{
"serverTemplates":[
{
"sequence":2,
"templateId":"ae435358-1410-40fd-803e-273028d19287",
"recipients":{
"signers":[
{
"email":"mmoreno509#gmail.com",
"name":"Test Tester",
"roleName":"Signer1",
"recipientId":718,
"tabs":{
"textTabs":[
{
"tabLabel":"Full Name",
"value":"Test Tester",
"pageNumber":"1"
},
{
"tabLabel":123123123,
"value":123123123,
"pageNumber":"1"
},
{
"tabLabel":"Address",
"value":"Test",
"pageNumber":"1"
},
{
"tabLabel":"City",
"value":"Hollywood",
"pageNumber":"1"
},
{
"tabLabel":"State",
"value":"FL",
"pageNumber":"1"
},
{
"tabLabel":"ZipCode",
"value":33081,
"pageNumber":"1"
},
{
"tabLabel":"Country",
"value":"US",
"pageNumber":"1"
},
{
"tabLabel":"Phone",
"value":"3454657676",
"pageNumber":"1"
},
{
"tabLabel":"AccountName",
"value":"Testing Company",
"pageNumber":"1"
},
{
"tabLabel":"\\*FullName",
"value":"Test Tester",
"pageNumber":"1"
}
]
}
}
]
}
}
]
},
{
"serverTemplates":[
{
"sequence":3,
"templateId":"017d0d20-754b-4093-8896-ff1c00ee2cda",
"recipients":{
"signers":[
{
"email":"mmoreno509#gmail.com",
"name":"Test Tester",
"roleName":"Signer1",
"recipientId":718,
"tabs":{
"textTabs":[
{
"tabLabel":"AccountName",
"value":"Testing Company",
"pageNumber":"1"
},
{
"tabLabel":123123123,
"value":123123123,
"pageNumber":"2"
}
]
}
}
]
}
}
]
},
{
"serverTemplates":[
{
"sequence":4,
"templateId":"11a88684-07ac-4ee5-9994-cb88635fb42f",
"recipients":{
"signers":[
{
"email":"mmoreno509#gmail.com",
"name":"Test Tester",
"roleName":"Signer1",
"recipientId":718,
"tabs":{
"textTabs":[
{
"tabLabel":"AccountName",
"value":"Testing Company",
"pageNumber":"2"
},
{
"tabLabel":"Address",
"value":"Test",
"pageNumber":"1"
},
{
"tabLabel":"City",
"value":"Hollywood",
"pageNumber":"1"
},
{
"tabLabel":"State",
"value":"FL",
"pageNumber":"1"
},
{
"tabLabel":"ZipCode",
"value":33081,
"pageNumber":"1"
}
]
}
}
]
}
}
]
}
]
}

You can not update template tabs upon creation of the envelope at this time.
Your signHereTabs is in your inlineTemplate, which will add additional tags to your envelope.
If you want to update tabs that are contained in a template via the API, your workflow should look like:
Create Envelope - ("status" : "created")
Modify Envelope - Edit tags here
Send Envelope
All of the documentation around building this workflow is located in DocuSign REST API Guide

Related

Constructing PHP Array for Hangouts Webhook

I'm trying to build the following Array with PHP so that I can send a card to Google Hangouts Chat Webhook.
{
"cards": [
{
"sections": [
{
"widgets": [
{
"keyValue": {
"topLabel": "Order No.",
"content": "12345",
"contentMultiline": "false",
"bottomLabel": "Delayed",
"onClick": {
"openLink": {
"url": ""
}
},
"icon": "TRAIN",
"button": {
"textButton": {
"text": "VISIT WEBSITE",
"onClick": {
"openLink": {
"url": ""
}
}
}
}
}
}
]
}
]
}
]
}
This is where I got to but does not seem to work..
$card["cards"]["sections"]["widgets"]["keyValue"]["topLabel"] = "Issue No";
$card["cards"]["sections"]["widgets"]["keyValue"]["topLabel"] = $_GET["issueid"];
$card["cards"]["sections"]["widgets"]["keyValue"]["contentMultiline"] = false;
Any help would be amazing, just a brief overview of how to contsruct the above array in PHP.
Thanks!
Solved.
$card["cards"]["sections"]["widgets"]["keyValue"]["topLabel"] = $_GET["issueid"];
this will overwrite above the one I think, I think ["topLabel"] should be ["content"] in the second index ??
Thanks #devpro

How to make dynamic elastic search query based on my given input values in Elastic Search

I have written elastic search query in static values, now i want to make as a dynamic like i have input fields, based on the input values i have to make my dynamic elastic search query. how can i do it? any one please update my answer.
INPUT
{
"userID" : "USER1",
"groupID" : "5b278f8856db693c457b4697",
"contentType " : "question",
"contentID" : "5",
"contentFlow": [
{
"contentId": "123",
"contentType": "topic"
},
{
"contentId": "456",
"contentType": "concept"
},
{
"contentId": "100",
"contentType": "sdl"
}
]
}
STATIC QUERY
{
"size":999,
"query":{
"bool":{
"must":[
{
"term":{
"userId":"USER1"
}
},
{
"term":{
"contentId":"5"
}
},
{
"bool":{
"must":[
{
"term":{
"contentPath.contentType":"topic"
}
},
{
"term":{
"contentPath.contentId":"123"
}
}
]
}
},
{
"bool":{
"must":[
{
"term":{
"contentPath.contentType":"concept"
}
},
{
"term":{
"contentPath.contentId":"456"
}
}
]
}
},
{
"bool":{
"must":[
{
"term":{
"contentPath.contentType":"sdl"
}
},
{
"term":{
"contentPath.contentId":"100"
}
}
]
}
}
]
}
}
}
I am new to learning elastic search, kindly help me out on this problem

[Dialogflow]Update Permission through Webhook format (for push notifications)

ORIGINAL REQUEST: I'm trying to implement the push notifications following the documentation: https://developers.google.com/actions/assistant/updates/notifications
I'm using Dialogflow with webhooks (in PHP) and the documentation is giving example in nodeJS
Right now, i'm blocked because of the Update permission, here's my Webhook response :
{
"source": "webhook",
"payload": {
"google": {
"expectUserResponse": true,
"systemIntent": {
"intent": "actions.intent.PERMISSION",
"data": {
"#type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"permissions": [
"UPDATE"
]
},
"updatePermission": {
"intent": "notification.simple.text"
}
}
}
}
}
When I do the simulation, asks me a permission for a push, but not for the intent I specified.
I'm quiet sure that the problem is the updatePermission, something must be wrong with that:
Is it the field name?
In intent, i put the intent name that i filled in dialogflow, maybe do i have to an use action? Is it in the good format ?
If someone can help me or just give me an example of a clean response for an update permission.
Thanks!
Solution
I just found why, my json wasn't good, the updatePermissionValueSpec must be into data object.
{
"source": "webhook",
"payload": {
"google": {
"expectUserResponse": true,
"systemIntent": {
"intent": "actions.intent.PERMISSION",
"data": {
"#type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"permissions": [
"UPDATE"
],
"updatePermissionValueSpec": {
"intent": "notification_simple_text"
}
}
}
}
}
}
I believe updatePermission should be named updatePermissionValueSpec.
Example response:
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "PLACEHOLDER"
}
}
]
},
"systemIntent": {
"intent": "actions.intent.PERMISSION",
"data": {
"#type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"permissions": [
"UPDATE"
],
"updatePermissionValueSpec": {
"intent": "intent_name"
}
}
}
}
}

PayPal - PHP API, custom webform, unsuccessful payment without any errors

I've got a webform, sending data (and the customer) to PayPal.
My JSON request:
{
"intent":"sale",
"payer":{
"payment_method":"paypal"
},
"redirect_urls":{
"return_url":"http://dev1.url.de/payment/execute?method=paypal&price=1&order_number=123465&success=true",
"cancel_url":"http://dev1.url.de/payment/execute?method=paypal&price=1&order_number=123465&success=false"
},
"transactions":[
{
"amount":{
"currency":"EUR",
"total":"1"
},
"item_list":{
"items":[
{
"name":"123465",
"currency":"EUR",
"quantity":1,
"price":"1"
}
]
},
"invoice_number":"123465"
}
]
}
and a PayPal response:
{
"id":"PAY-0YV50781X7702245FKVDWC5A",
"create_time":"2015-05-04T12:09:24Z",
"update_time":"2015-05-04T12:09:24Z",
"state":"created",
"intent":"sale",
"payer":{
"payment_method":"paypal",
"payer_info":{
"shipping_address":{
}
}
},
"transactions":[
{
"amount":{
"total":"1.00",
"currency":"EUR",
"details":{
"subtotal":"1.00"
}
},
"invoice_number":"123465",
"item_list":{
"items":[
{
"name":"123465",
"price":"1.00",
"currency":"EUR",
"quantity":"1"
}
]
},
"related_resources":[
]
}
],
"links":[
{
"href":"https://api.paypal.com/v1/payments/payment/PAY-0YV70781X7192245FKVDWC5A",
"rel":"self",
"method":"GET"
},
{
"href":"https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-38Y65870AE087743W",
"rel":"approval_url",
"method":"REDIRECT"
},
{
"href":"https://api.paypal.com/v1/payments/payment/PAY-0YV50781X7170245FKVDWC5A/execute",
"rel":"execute",
"method":"POST"
}
]
}
And going through the payment process on the PayPal website seems all to be fine.
I can login, I can see all correct details and after I click on send payment, it redirects me to my form (return_url) and it says I paid.
The thing is .. it's not paid.
I can't see the money sent and it never arrives - not transaction is triggered. How can I figure out the problem? Or does anybody have a clue?

Getting random output json

I trying to get a youtube channel banner from the youtube api.
But this is very weird.
I use this code:
$json1 = file_get_contents("http://gdata.youtube.com/feeds/api/partners/$channel/branding/default?key=[api-key]&alt=json");
$data1 = json_decode($json1, true);
$banner = $data1['entry']['yt$option'][15]['$t'];
echo $banner;
Now the weird thing, when i refresh te page i get everytime a new value. but sometimes it will stay one value and thats what i need but after some thime the value is changing...
This is the json code:
{
"version":"1.0",
"encoding":"UTF-8",
"entry":{
"xmlns":"http://www.w3.org/2005/Atom",
"xmlns$yt":"http://gdata.youtube.com/schemas/2007",
"id":{
"$t":"http://gdata.youtube.com/feeds/api/partners/rebasenetwork/branding/default"
},
"published":{
"$t":"2014-02-28T22:08:37.000Z"
},
"updated":{
"$t":"2014-02-28T22:08:37.000Z"
},
"category":[
{
"scheme":"http://schemas.google.com/g/2005#kind",
"term":"http://gdata.youtube.com/schemas/2007#branding"
}
],
"link":[
{
"rel":"self",
"type":"application/atom+xml",
"href":"http://gdata.youtube.com/feeds/api/partners/rebasenetwork/branding/default"
},
{
"rel":"edit",
"type":"application/atom+xml",
"href":"http://gdata.youtube.com/feeds/api/partners/rebasenetwork/branding/default"
}
],
"yt$option":[
{
"$t":"0",
"name":"channel.banner.image_height.int"
},
{
"$t":"http://i1.ytimg.com/u/Yd24MzwIk2gLiv79JNPGSA/channels4_mobile_banner_hd.jpg?v=52d6ad2b",
"name":"channel.banner.mobile.hd.image.url"
},
{
"$t":"http://i1.ytimg.com/u/Yd24MzwIk2gLiv79JNPGSA/channels4_tablet_banner.jpg?v=52d6ad2b",
"name":"channel.banner.tablet.medium.image.url"
},
{
"$t":"https://lh6.googleusercontent.com/-6xCc8OBY5Qk/UtatKX2WY3I/AAAAAAAAAAY/6-vpTOgd0yU/w854-fcrop64=1,00000000ffffffff/channels4_banner.jpg",
"name":"channel.banner.tv.low.image.url"
},
{
"$t":"https://lh6.googleusercontent.com/-6xCc8OBY5Qk/UtatKX2WY3I/AAAAAAAAAAY/6-vpTOgd0yU/w1280-fcrop64=1,00000000ffffffff/channels4_banner.jpg",
"name":"channel.banner.tv.medium.image.url"
},
{
"$t":"#000000",
"name":"channel.global.color"
},
{
"$t":"http://i1.ytimg.com/u/Yd24MzwIk2gLiv79JNPGSA/channels4_banner.jpg?v=52d6ad2b",
"name":"channel.banner.image.url"
},
{
"$t":"http://i1.ytimg.com/u/Yd24MzwIk2gLiv79JNPGSA/channels4_mobile_banner_low.jpg?v=52d6ad2b",
"name":"channel.banner.mobile.low.image.url"
},
{
"$t":"True",
"name":"channel.modules.show_comments.bool"
},
{
"$t":"https://lh6.googleusercontent.com/-6xCc8OBY5Qk/UtatKX2WY3I/AAAAAAAAAAY/6-vpTOgd0yU/w2120-fcrop64=1,00000000ffffffff/channels4_banner.jpg",
"name":"channel.banner.tv.image.url"
},
{
"$t":"http://i1.ytimg.com/u/Yd24MzwIk2gLiv79JNPGSA/channels4_tablet_banner_hd.jpg?v=52d6ad2b",
"name":"channel.banner.tablet.hd.image.url"
},
{
"$t":"Welcome to our network Channel. We help Youtubers to earn money and grow with their channel. Being famous on youtube is one of the things you dream about, isn't it? Let us help make your dreams true!\n\nWith us you can choose your own partnership, You also select what you want to earn from your youtube channel! Are you ready to start growing? Partner Now!",
"name":"channel.global.description.string"
},
{
"$t":"http://i1.ytimg.com/u/Yd24MzwIk2gLiv79JNPGSA/channels4_mobile_banner_medium_hd.jpg?v=52d6ad2b",
"name":"channel.banner.mobile.medium_hd.image.url"
},
{
"$t":"https://lh6.googleusercontent.com/-6xCc8OBY5Qk/UtatKX2WY3I/AAAAAAAAAAY/6-vpTOgd0yU/w1920-fcrop64=1,00000000ffffffff/channels4_banner.jpg",
"name":"channel.banner.tv.high.image.url"
},
{
"$t":"http://i1.ytimg.com/u/Yd24MzwIk2gLiv79JNPGSA/channels4_mobile_banner.jpg?v=52d6ad2b",
"name":"channel.banner.mobile.medium.image.url"
},
{
"$t":"http://i1.ytimg.com/u/Yd24MzwIk2gLiv79JNPGSA/channels4_mobile_banner.jpg?v=52d6ad2b",
"name":"channel.banner.mobile.image.url"
},
{
"$t":"True",
"name":"channel.related_channels.show.bool"
},
{
"$t":"KQvIpdiWrSI",
"name":"channel.unsubscribed_trailer.video_id.string"
},
{
"$t":"http://i1.ytimg.com/u/Yd24MzwIk2gLiv79JNPGSA/channels4_tablet_banner_extra_hd.jpg?v=52d6ad2b",
"name":"channel.banner.tablet.extra_hd.image.url"
},
{
"$t":"http://i1.ytimg.com/u/Yd24MzwIk2gLiv79JNPGSA/channels4_tablet_banner_low.jpg?v=52d6ad2b",
"name":"channel.banner.tablet.low.image.url"
},
{
"$t":"True",
"name":"channel.modules.moderate_comments.bool"
},
{
"$t":"Network partner partnership rebase network pewdiepie",
"name":"channel.global.keywords.string"
},
{
"$t":"Rebase Network",
"name":"channel.global.title.string"
},
{
"$t":"http://i1.ytimg.com/u/Yd24MzwIk2gLiv79JNPGSA/channels4_mobile_banner_extra_hd.jpg?v=52d6ad2b",
"name":"channel.banner.mobile.extra_hd.image.url"
}
]
}
}
This is the one i need(just the url):
{
"$t":"http://i1.ytimg.com/u/Yd24MzwIk2gLiv79JNPGSA/channels4_tablet_banner_extra_hd.jpg?v=52d6ad2b",
"name":"channel.banner.tablet.extra_hd.image.url"
},
Can someone help me please? i really don't understand why it's changing the value every refresh..
You can loop through the results and print out the one where the name matches channel.banner.mobile.extra_hd.image.url
$data1 = json_decode($json1, true);
foreach ($data1['entry']['yt$option'] AS $banner) {
if ($banner['name'] == 'channel.banner.mobile.extra_hd.image.url') {
print $banner['$t'];
}
}

Categories