I would like to retrieve the URL associated with (some) Evernote notes, as seen in this screenshot:
Need for ENNoteAdvanced
After some digging, I found that the object ENNoteAdvanced has a property SourceUrl that should be exactly what I need.
However, I cannot find a way to download or cast an existing note as ENNoteAdvanced
Code for retrieving ENNote but how about ENNoteAdvanced
ENNote downloadedNote = sharedSession.DownloadNote(noteRef);
I fear the API only allows creating new advanced notes for uploading, but does not allow working with existing downloaded notes as advanced notes?
You are correct, that was a shortcoming of the new Evernote Windows SDK. So I just modified the SDK so as to support calling DownloadNote from the Advanced interface, which will return an ENNoteAdvanced instead of an ENNote.
In other words, do this:
ENSessionAdvanced.SetSharedSessionConsumerKey("your key", "your secret");
...[your code which authenticates, then gets you a valid noteRef]...
ENNoteAdvanced downloadedNote = ENSessionAdvanced.SharedSession.DownloadNote(noteRef);
Console.WriteLine(downloadedNote.SourceUrl);
The updated SDK is available on Github now.
Related
I know that the query:
https://graph.microsoft.com/v1.0/me/messages
Corresponds to:
GraphClient.Me.Messages.Request().GetAsync()
I am trying to replicate the following requests in Microsoft Graph Client SDK :
Get All Categories
https://graph.microsoft.com/beta/me/outlook/masterCategories
Corresponding Graph client query: ??
Get All messages that contain certain words in their subject
The link will be similar to this
https://graph.microsoft.com/v1.0/me/messages?$search="hello world"
Corresponding Graph Client : ??
Update each of these messages with a category
?
The documentation only gives 2 examples, where could i find a list of examples/reading material on this?
The SDK is generated for the production endpoint (v1.0), so you will have to make a custom request for beta APIs
List<QueryOption> options = new List<QueryOption>
{
new QueryOption("$search", "hello world")
};
var filteredMessages = await
graphClient.Me.Messages.Request(options).GetAsync();
This also requires using custom requests since this is beta functionality.
We appreciate your feedback about our docs and how to use the SDK. We have some additional reference in the repo and are continuing to examine options for improving our SDK docs.
Since I don't have enough reputation points, I had to post an answer instead of a comment.
Thanks user8608110 for your help. Unfortunately, I can't use graph explorer because I'm not an admin. I think I have my patch request setup correctly, but I keep getting an "Empty Payload" error.
I thought stackoverflow was for us to help each other not delete the post of people trying to get help.
Yesterday, I was using this line of code with the version 1.5.0-preview of Microsoft.Azure.Management.ResourceManager :
var listResources =
ResourceManagementClient.ResourceGroups.ListResources(resourceGroup.Name);
Today, I have updated to version 1.6.0-preview but the fonction doesn't seem to be available anymore. Is there another way to get the list of the resources contained in a resource group ?
Now the SDK is still preview version. In the 1.6.0 preview version. It should use following code.
var listResources = resourceManagementClient.Resources.ListByResourceGroup("ResourceGroup Name");
But it still can't work correctly on my side because the API-Version is api-version=2017-05-10. I catch the request with fiddler.
The code you mentioned that use API-version
var listResources =
ResourceManagementClient.ResourceGroups.ListResources(resourceGroup.Name);
Note : Please still use 1.5.0-preview instead of 1.6.0-preview currently if you want get group resource, or give your feedback to azure sdk team . Or you can use REST API directly
I am new to Trello.Net and struggling a little with authorisation. I understand the process, of requesting a URL and then asking the user to browse to that URL to get a token.
The first problem is I am trying to write a process which runs automatically without any UI. So I'm having to use a hard coded token, which I obtained by running this code to get a URL, which I then browse to manually. I would rather do this part automatically (get the resulting token programatically, not by having the user browse somewhere):
ITrello trello = new Trello(Key);
var url = trello.GetAuthorizationUrl("TrelloCapture", Scope.ReadWrite, Expiration.Never);
Console.WriteLine(url);
This URL, when I browse to it, displays for me a token which, for now, I hardcoded into my application as follows:
var token = "[the token copied and pasted from the web page]"
I then authorise using:
trello.Authorize(token);
Which seems to work fine. Next I want to access some basic data, and this is where my second problem comes in.
// Get the authenticated member
Member me = trello.Members.Me();
Console.WriteLine(me.FullName);
Members.Me() returns null every time. The same problem with Cards.ForMe() and other methods. Everything is null. Why?
What am I doing wrong?
I found the answer. I fixed it by getting the latest versions of these NuGet packages in my solution:
Trello.Net
JSON.Net
RestSharp
After getting those latest versions I was seeing proper values instead of null in the trello objects.
Hope this helps somebody who reads this.
Had the same problem, above answer helped me.
Though I couldn't get the latest but had to use:
"RestSharp" version="104.1
"Newtonsoft.Json" version="6.0.1"
Since The nuget also doesn't have the correct color enum i had to download the project and make my own changes.
I have a client that wants to sell tutorial videos online. I already got previews of his tutorials streaming from CF (This is public). Now I want to use the c# sdk to generate private, time limited URLs to allow customers who purchased the tutorials to download them for a limited time period.
Once the payment has been confirmed, I want to generate a URL and send it to the client via email.
Does CF/.NET SDK support this?
Can someone point me at a sample. I have searched Google, and got a little information overload. Different examples from different versions of sdk/management console. Please help me make sense of it all :)
If you look at the class Amazon.CloudFront.AmazonCloudFrontUrlSigner that has helper methods for creating presigned URL to private distributions. For example this code snippet creates a url that is valid for one day.
var url = AmazonCloudFrontUrlSigner.GetCannedSignedURL(AmazonCloudFrontUrlSigner.Protocol.http, domainName, cloudFrontPrivateKey, file, cloudFrontKeyPairID, DateTime.Now.AddDays(1));
There are other utility methods in that class for adding more specific access rules.
Note this class was added in version 1.5.2.0 of the SDK which came out in late Augest
Yes Amazon S3 as well as CloudFront both support preSignedUrl access. If you want to faster content delivery the you should use CloudFront. Mr. Norm Johanson saying correct. To generate signed url you will need of Public-Private key pair. You can user your own key pair and lets associate with you account of Amazon S3 or you can also generate it at amazon s3 account and download to generate presigned url
You can use the GUI or code in S3SignURL to sign your URL
https://github.com/DigitalBodyGuard/S3SignURL
You can't do this with CloudFront (CF), but you can do this directly with S3. You simply call the GetPreSignedURL function to generate a time-limited URL to a specific (private) S3 item. This approach is covered in a tutorial here.
The simplest code sample is this:
AmazonS3 client;
GetPreSignedUrlRequest request = new GetPreSignedUrlRequest();
request.WithBucketName(bucketName);
request.WithKey(objectKey);
request.Verb = HttpVerb.GET; // Default.
request.WithExpires(DateTime.Now.AddMinutes(5));
string url = client.GetPreSignedURL(request);
Currently I am using Codeplex's Facebook Developer Toolkit version 2 for my ASP.net Facebook application. I would like to be able to send notifications to a user's Inbox or wall of the application and was wondering what are the available functions to do that? If not in the API, then please provide example functions from the main Facebook library. This will help immensely. Thanks!
After a brief search I found an example of sending notifications using the toolkit:
facebook.Components.FacebookService fs
= new facebook.Components.FacebookService();
fs.ApplicationKey =
ConfigurationManager.AppSettings["APIKey"];
fs.Secret =
ConfigurationManager.AppSettings["Secret"];
string sessionKey =
dict["facebook_session_key"];
fs.SessionKey = sessionKey; fs.uid =
long.Parse(member.FacebookId);
fs.notifications.send(member.FacebookId,
"notification message");
(from: http://facebooktoolkit.codeplex.com/Thread/View.aspx?ThreadId=49876)
After looking through the Codeplex source it's clear that this sends a user-to-user notification, and therefore requires an active user session of the sender.
Codeplex does not appear to support app-to-user notifications which do not require a session, but adding this feature would be trivial. Add a type variable to the send method and set it accordingly based on the API documentation here: http://wiki.developers.facebook.com/index.php/Notifications.send
The source code for the notifications.send method in the Codeplex Developer Toolkit is here:
http://facebooktoolkit.codeplex.com/SourceControl/changeset/view/28656#233852
Please keep in mind that the Codeplex developer toolkit source code has not been updated in over 3 months. This means that it does not support many new Facebook API features and changes. You may want to browse the client library wiki page to find a library that is more up to date: http://wiki.developers.facebook.com/index.php/Client_Libraries