PHP: Docusign API autopopulate tabs for template - php

Objective: Autopopulate some values using the tabLabel/value key pair for server templates, using the beta Docusign PHP Client.
I've looked at quite a few stackoverflow posts and unfortunately the one that seems to be the closest related to me seems unanswered: Docusign API - prefilling tab values on envelope created from template
I was unable to find this "SecureField" option in any sort of preferences.
Currently, the name field fills in automatically just because of the template role being set accurately. I didn't have to do this with the tabLabel key, this was done automatically. I have tried creating a company tab, and that fails to autopopulate, so does a random text tab I have tried.
I have currently forked the library and made it PSR-4 compatible, and to achieve this objective I changed the following files:
TemplateRole Model: Modified the constructor to include $tabs, and set $this->tabs if $tabs is set. I added two functions getTabs()/setTabs($tabs) that behave the same as get/set RoleName, Name, Email, etc.
RequestSignatureResource: In the foreach ($templateRoles as $templateRole) I added a 'tabs' key to the array_pusy, and put $templateRole->getTabs().
I created a new TemplateRole('role name', 'person name', 'email', $tabs).
I can see the tabs in the JSON request data. Is there anything I'm missing?
I should also note that I used this post for inspiration, too: How to pre-fill tabs on a server template with the DocuSign API. The issue with this is that if I put textTabs:{text:{tabLabel:"something", value:"some value"}} then I get a response from the API that my request was invalid. I can provide that specific error upon request if needed.

The following worked for me :
$templateRole = new DocuSign\eSign\Model\TemplateRole();
$templateRole->setClientUserId($email);
$templateRole->setEmail($email);
$templateRole->setName($recipientName);
$templateRole->setRoleName($templateRoleName);
$textTab = new \DocuSign\eSign\Model\Text();
// I added this text field manually on docuSign site.
$textTab->setTabLabel("Field Label");
$textTab->setValue('Value');
$tabs = new DocuSign\eSign\Model\Tabs();
$tabs->setTextTabs(array($textTab));
$templateRole->setTabs($tabs);

Related

Google Drive PHP method listFiles and get return 'thumbnailLink' NULL

I'm using the PHP V2 API. I requested full access (scope: https://www.googleapis.com/auth/drive). I also tried adding all of the different scopes to no avail.
I'm fully able to retrieve all files and list them but the thumbnail link is always null. Same with 'hasThumbnail'.
I tried the API explorer on https://developers.google.com/drive/v2/reference/files/get#examples and it shows me the thumbnail links correctly.
The relevant code can be boiled down to this:
$drive = new Google_Service_Drive($this->client);;
$files = $drive->files->listFiles($parameters)->files;
This is the response from the API explorer.
The response from my code (for the same ID) is:
Found the solution. It took 5 hours to run into this such simple solution.
Not many fields show by default, you must specify which fields you want populated.
The modified basic query now is:
$this->drive->files->listFiles([
'fields' => 'nextPageToken, files(thumbnailLink, webViewLink)'
])->files;

Docusign api php add signer on the fly to template

when i add new recepient and sent the document in template using below code
$templateRole = new \DocuSign\eSign\Model\TemplateRole();
$templateRole->setEmail("user#email.com");
$templateRole->setName("User Name");
$templateRole->setRoleName("Admin");
I use Docusign Php Client, you can find the whole code below I used for this on that page.
Here it send the email containing document to user#email.com, but user#email.com's user is not able to sign that document.
I've also added the dynamic text to the document in the template.Added one signer recipient to template (because i was not able to add the dynamic labels without it), this user get all the emails even i don't specify him on the above code.
I want something like to send a document in template to different recepients (like user1#gmail.com, user2#gmail.com etc) one at a time (they may or may not have docusign account, though is it possible if they have docusign account?)
I am doing this since 4 days, not finding anything about proceeding furthur, please help.
I have read some of the documentation. As far as I can see you should do the following:
//first signer
$templateRole1 = new \DocuSign\eSign\Model\TemplateRole();
$templateRole1->setEmail("user1#email.com");
$templateRole1->setName("User1 Name");
$templateRole1->setRoleName("Admin");
//second singer
$templateRole2 = new \DocuSign\eSign\Model\TemplateRole();
$templateRole2->setEmail("user2#email.com");
$templateRole2->setName("User2 Name");
$templateRole2->setRoleName("Admin");
And then in the envelop:
$envelop_definition->setTemplateRoles(array($templateRole1, $templateRole2));

PHP DocuSign API - Create a non-required field

I am using the PHP library provided by DocuSign within my application.
I would like to know how to create a text field that is NOT required to be filled in by the user.
Here's a snippet of what I'm doing.
$text = new \DocuSign\eSign\Model\SignHere();
$text->setAnchorString("Name");
$text->setAnchorXOffset("100");
$text->setAnchorYOffset("-20");
$text->setTabLabel("Name");
$text->setName("Name");
$text_tabs[] = $text;
$tabs = new DocuSign\eSign\Model\Tabs();
$tabs->setTextTabs($text_tabs);
I want this field to be optional but it's always required when trying to complete the signing process.
Any help would be appreciated!
I believe you just need to set the optional property of the text tab to true.
$text->setOptional("true");
(8/17/16: Updated answer to reference the optional property -- instead of the required property.)

Displaying a list of videos from a channel - Vimeo Advanced API

I need a way to display videos from a specific channel on a page using PHP.
I have authenticated my app and I can use some methods using the advanced API. I am using the official vimeo PHP library to connect.
Below is what I am trying to do and when I dump the array I do not get anything. I can get info back from using get videos from the entire account method.
require_once('/url/vimeo/vimeo.php');
$vimeo = new phpVimeo('number', 'number');
$vimeo->setToken('number','numbers');
$videos = $vimeo->call('vimeo.channels.getVideos', array('ACCOUNT' => 'NAME'));
If I put the channel name where ACCOUNT is I will get an invalid signature error.
Is it worth using something like simple HTML parser for PHP and doing it that or worth sticking with the advanced API?
I would highly advise using the advanced api. If you parse the html, it will break any time vimeo changes their channel pages. Additionally, channels have more than one layout
eg: vimeohq and nicetype
The second parameter of the "call" function should be any querystring parameters the api method requires.
In the case of "vimeo.channels.getVideos" you can provide
channel_id
user_id
page
per_page
summary_response
full_response.
To experiment with the getVideos method, you can use the playground.
So in the end, I believe you want the function to look like this..
$videos = $vimeo->call('vimeo.channels.getVideos', array('channel_id' => 'NAME'));
where NAME is either the channel id, or the channel name (the channel name matches the url slug, so for example "nicetype" not "nice type"

Mahana Module for CodeIgniter

I am making an application in CodeIgniter and I need a Messaging Library Module there and I got a Library name Mahana. The Link is as follows.
https://github.com/jrmadsen67/Mahana-Messaging-library-for-CodeIgniter/tree/master/application
But I am unable to apply it as it has no controller and View portion. I am very new to CodeIgniter. Can any one provide me any link of total Mahana Librery or any other Messaging Library for CodeIgniter
Thank You
What's your problem ?
First you must create in the db, the tables from the dump mahana.sql,
and after use the variable that are in the configuration file config/mahana.php (USER_TABLE_TABLENAME, USER_TABLE_ID, and USER_TABLE_USERNAME) to integrate with a fast table access.
To use the library just put in your controller :
$this->load->library('mahana_messaging');
after that, when you want to get a message, create an object, and put in the method *get_message* the message id, and sender id, it will return a single message, including the status for specified user.
$mahana = new Mahana_messaging();
$msg = $mahana->get_message($msg_id, $sender_id);
U can also get the full thread of conversation using the method *get_full_thread*, it will return a entire thread conversation. To send a new internal message, that create a new thread, you must use the method *send_new_message* and pass the sender id, the recipient, the subject, the body, and finally the priority (this information, usually will be get from a web form, that you have created previously)
function send_new_message($sender_id, $recipients, $subject='', $body='', $priority=PRIORITY_NORMAL)
and so on ... there are other functions that permit you to reply a message, get partecipant...
Good work
Does this help at all????

Categories