Docusign API and printing documents - printing

I am able to create an e-signature with a pdf on the docusign api that I have setup within the Docusign sandbox. However, one of the requirements for my project is to pre-populate the pdf on docusign and then render it into a browser for printing.
Whenever I create the document within the envelope for e-signature, all of the passed-in fields are in the document. However, if I only create the document, then try to view it, all of the fields I am passing in are blank.
How can I have these passed in fields to stay persistent within the envelope document and then show that document within a browser?

Without seeing your code it's hard to say what you're doing wrong.
I can tell you how it should be done. Not sure what lang you're using. in C# you can do this:
// Add the tabs model (including the SignHere tab) to the signer.
// The Tabs object wants arrays of the different field/tab types
// Tabs are set per recipient/signer
Tabs signer1Tabs = new Tabs
{
SignHereTabs = new List<SignHere> { signHere },
TextTabs = new List<Text> { textLegal, textFamiliar, textSalary }
};
signer1.Tabs = signer1Tabs;
Recipients recipients = new Recipients
{
Signers = new List<Signer> { signer1 }
};
(you can find the full code example and all the other languages in our code example on the Developer Center)

Related

How to get link to third party site in 'about channel' section via python

I want to display information about links in the YouTube profile in a text document, I tried to do it through the requests library, but Google gave links to privacy and security, I did not find information about this in the YouTube API documentation. Who knows, you can help with this
This isn't possible to get using the YouTube API, I actually found myself needing to do the same thing as yourself and was not able to because the YouTube API lacked the necessary functionality (Hopefully, It will be added soon!)
I see you mentioned Python, My only solution is in Node but I will do a large explanation and you can base your code off of it. In order to get the banner links without the YouTube API, we need to scrape the data, since YouTube uses client-side rendering we need to scrape the JSON configuration from the source.
There's a variable defined inside a script called ytInitialData which is a big JSON string with a massive amount of information about the channel, viewer, and YouTube configurations. We can find the banner links by parsing through this JSON link.
const request = require("request-promise").defaults({
simple: false,
resolveWithFullResponse: true
})
const getBannerLinks = async () => {
return request("https://www.youtube.com/user/pewdiepie").then(res => {
if (res.statusCode === 200) {
const parsed = res.body.split("var ytInitialData = ")[1].split(";</script>")[0]
const data = JSON.parse(parsed)
const links = data.header.c4TabbedHeaderRenderer.headerLinks.channelHeaderLinksRenderer
const allLinks = links.primaryLinks.concat(links.secondaryLinks || [])
const parsedLinks = allLinks.map(l => {
const url = new URLSearchParams(l.navigationEndpoint.commandMetadata.webCommandMetadata.url)
return {
link: url.get("q"),
name: l.title.simpleText,
icon: l.icon.thumbnails[0].url
}
})
return parsedLinks
} else {
// Error/ratelimit - Handle here
}
})
}
The way the links are scraped is as follows:
We make a HTTP request to the channel's URL
We parse the body to extract the JSON string that the banner links are inside using split
We parse the JSON string into a JSON object
We extract the links from their JSON section (It's a big JSON object data.header.c4TabbedHeaderRenderer.headerLinks.channelHeaderLinksRenderer
Because there are two types of links (Primary, the one that shows the text and secondary, links that don't show the text) we have to concatenate them together so we can map through them
We then map through the links and use URLSearchParams to extract the q query parameter since YouTube encrypts their outgoing links (Most likely for security reasons) and then extract the name and icon too using their appropriate objects.
This isn't a perfect solution, should YouTube update/change anything on their front end this could break your program easily. YouTube also has rate limits for their software if you're trying to mass scrape you'll run into 429/403 errors.

how to create a zendesk ticket with inline image

I would like to create a ticket with inline image but cannot get through it. I am using a rich text having a pasted screen capture image, the content is like
"<img ..."
By using ZendeskApi_V2, I set the Ticket's Comment HtmlBody with the content mentioned but did not work, neither of PlainBody or Body.
Anyone can help, please.
For instance:
In my application, an image is inserted into a RadEditor
By setting the Ticket.Comment as
var ticket = new Ticket {
Comment = new Comment {
HtmlBody = HttpUtility.HtmlDecode(RadEditor.Content)
}
}
After sending the Create Ticket request, I cannot see the inline image in the Zendesk dashboard.
So, did I do it in a right way? How should an embedded or inline image be sent through Zendesk API?
You may need to upload the attachment file first, then you can set the attachment's token in the comment. See here - https://developer.zendesk.com/rest_api/docs/support/tickets#attaching-files

How to fetch mail by id with barbushin imap class

I'm currently working on the imap class by barbushin. It's the only php class over the internet I can find regardless to any encoding issue. Thanks to the coder.
I have a list of messages in a table. Each message sending a message id as GET (say $mid). When a link clicked, the page turned into a view page. It should open that message and display the relevant content right? But it is not. Every message has the same content (the 1st content). The code is designed for gmail but I use it for my client. And it's work.
This is a code:
require_once('../ImapMailbox.php');
define('EMAIL', 'my#domain.com');
define('PASSWORD', '*********');
define('ATTACHMENTS_DIR', dirname(__FILE__) . '/attachments');
$mailbox = new ImapMailbox('{imap.gmail.com:993/imap/ssl}INBOX', EMAIL, PASSWORD, ATTACHMENTS_DIR, 'utf-8');
$mails = array();
// Get some mail
$mailsIds = $mailbox->searchMailBox('ALL');
if(!$mailsIds) {
die('Mailbox is empty');
}
$mailId = reset($mailsIds);
$mail = $mailbox->getMail($mailId);
var_dump($mail);
var_dump($mail->getAttachments());
The original is here: https://github.com/barbushin/php-imap
Finally, I found my way home. According to the script there's a line says "mailId". Which is straight forward what is it about.
It was set to the first array by reset(). So the only thing I need to do is extract the message id from it ($mailId is an array of ids). So I simply add an array behind it.
$mailId=$mailsIds[$_GET[uid]];
While $_GET[uid] is a message id sent from a previous page.

Create Snapshot/Thumbnail of a blog entry using mvc

I need to generate a snapshot from multiple links of blogs.
What i have is a list of text like these
"Report: Twitter Will Release Music Discovery App This Month http://on.mash.to/10L1v49 via #mashable"
I want to show the links as snapshot of the blog, followed by its text in my view. Or at least i need to get the picture attached to the blog.
Using facebook debug, http://developers.facebook.com/tools/debug ,i am getting this..
fb:app_id: 122071082108
og:url: http://mashable.com/2013/03/13/twitter-music-app/
og:type: article
og:title: Report: Twitter Will Release Music Discovery App This Month
og:image:
og:description: Twitter is planning to release a standalone music app for iOS called Twitter Music as soon as the end of this month, according to CNET. CNET reports that Twitter Music will help...
og:site_name: Mashable
og:updated_time: 1363267654
I tried the same link from my c# code, accessed the link with parameter 'q' as my desired link. I got the same html as reply but i am unable to find the image associated as it is coming differently for different links.
Can anyone suggest a better method to do this in mvc?
My code in controller to access facebook debug :
var client = new RestClient
{
BaseUrl = "http://developers.facebook.com/tools/debug/og/object"
};
var request = new RestRequest
{
DateFormat = DataFormat.Xml.ToString(),
Resource = "Add",
Method = Method.GET
};
request.AddParameter("q", "http://on.mash.to/10L1v49");
IRestResponse response = client.Execute(request);
var content = response.Content; // raw content as string
What i understand from your question is, you need something like the preview of a link what we get on pasting some link on facebook share area.
Facebook debug method returns an html page which has the image of your blog entry from the link given.
Use HtmlAgilityPack to parse your html returned from facebook debug
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.LoadHtml(content);
HtmlNode root = doc.DocumentNode;
var imageurl = doc.DocumentNode.SelectNodes("//img/#src").LastOrDefault();
string imagesrc = imageurl.OuterHtml.ToString();
int start = imagesrc.IndexOf("url=");
int to = imagesrc.IndexOf("\"", start + "url=".Length);
string s = imagesrc.Substring(
start + "url=".Length,
to - start - "url=".Length);
string a = Uri.UnescapeDataString(s);
and..there you have your image of the blog entry. Same function can be modified to retireve the title, description and the updated time of the blog entry.

User not valid from external link

I have a website that outputs Excel reports with hyperlinks back to secure content. One of the links would look like this...
http://www.[site].com/externalLinkDigester?externalSession=[SHA Encrypted Text]
The query string argument (externalSession) is a unique alphanumeric string that is only valid for 24 hours and can only be accessed by the user who created the report. My controller looks something like this...
class ExternalLinkDigester{
def springSecurityService;
def index = {
def currentUser = springSecurityService?.currentUser
if (!currentUser){
redirect(controller:'login')
}
def request = ExternalSession.findByName(params.externalSession);
if (request.isExpired(){
//show expired content page
}
if (sameUser(currentUser, request.user){
//show content
}else{
redirect(controller:'login')
}
}
}
The problem is that no matter what the springSecurityService.currentUser is always null when coming form an external program like Excel even when I am logged before clicking the link however, if I copy and paste the link into the browser it seems to work fine. Help!
How can I securely access content this way?
Is it possible that Excel is opening up a different browser than the one you logged in with (eg. you logged in with Firefox and when clicking the link within excel, it defaults to opening the link within Internet Explorer). The new browser will not have the session cookie for the authenticated session so "currentUser" will appear as null.

Resources