Finding the content element of a gdata entry - google-docs

The Google Documents List API (v3) references a "content element" several times. In the content element there is a URI to export the file and the mime type of the file.
How can I find the content element and extract that information?
Thank you!

i used google oauth playground to make a sample request - posted response on pastebin...
Following the 'title' element, you can see the 'content' element you requested with the URI containing a node=export.
"content":{
"type":"text/html",
"src":"https://docs.google.com/feeds/download/documents/export/Export?id\u003d1mCHy6rcaqFoyZaJ-3qwRBZyirxnmew1m4CfEtOWAhjw\u0026v\u003d3"
},
once i authenticated to the playground , i used the following request for this example:
https://docs.google.com/feeds/default/private/full?v=3&alt=json&max-results=1
Using playground and json prettyprint instructions in my answere here

Related

Filtering by file type or name in Microsoft Graph API

If I want to find just image files using the Microsoft Graph API. Is there a way to filter using $filter? By file type or name "endswith"?
I try
https://graph.microsoft.com/v1.0/sites/{MyID}.sharepoint.com/lists/{Drive ID}/items?$filter=endswith(webUrl, '.png')
but got this error
"message": "Item not found",
but there is an image (.png) file contain in the drive
, My goal is to get response all of image file that contain in Drive in Sharepoint
Yeah, I agree that there is no name property populated in the response even if its documented here that there is a name property. And all properties doesn't support all ODATA query parameters as far as I know.
But you can do one thing. There is a fields relationship which you can use to get the filename with extension. Use the query below.
https://graph.microsoft.com/v1.0/sites/soaadteam.sharepoint.com/lists/8f7fc3c2-8d9b-4563-94c8-b63bf0f19ebc/items?$expand=fields
Pick that LinkFilename property from fields property and you can filter it on your end(by writing code) easily.

How to remove a reference of task details with an external reference in planner using the beta Microsoft Graph API

I'm newbie to the Microsoft Graph API and I want to use it to remove a reference (link) of a task details in planner.
As part of the updating a task details I use the externalReferenceCollection and to perform the update I follow the link below: http://graph.microsoft.io/en-us/docs/api-reference/beta/api/taskdetails_update
Documentation from Microsoft also says that: "Properties of an Open Type can be defined by the client. In this case, the client must provide valid URLs based on the HTTP/HTTPS protocols as properties and their values must be the externalReference objects. Based on OData, property names in Open Types cannot contain the following characters: ., :, % so they need to be encoded. Example is shown above. To remove a reference, set the value of the property to null"
But I'm not sure how to set the value of property to null to build up a JSON string to remove a reference (link) of a task details.
PS: I'm using HttpClient in C# and the way to update a task details is similar to this class: https://github.com/OfficeDev/TrainingContent/blob/master/O3653/O3653-15%20Microsoft%20Graph%20for%20Planner%20and%20Tasks/Completed%20Solutions/Exercise3/Office365PlannerTask/Office365PlannerTask/Models/MyTasksRepository.cs
Thanks in advance!
Tuan
Finally, I've figured out the answer. I post here so it should help.
To remove a reference with the url is "http%3A//2%2Eff%2E2%2E1" for instance, the request body JSON of the references should look like as below:
{"description": "task description 1", "references": {
"http%3A//2%2Eff%2E2%2E1": null
}}
Happy coding!

can array of links be fetched / resolved in an Entry request

I am requesting a specific Entry and one of the fields of that Entry is an array of links. Is there a way to get those links to be resolved and returned in the resulting JSON response?
I am trying this via curl
curl -v https://cdn.contentful.com/spaces/o2bhdl4js7ak/entries/<entryID>?access_token=<accessToken>&include=2
The "include=n" parameter does not work in this particular case. should it?
Here's a snippet with the field I expect to be resolved / expanded
"lessons": [
{
"sys": {
"type": "Link",
"linkType": "Entry",
"id": "26hzvgmWtqOcKeoeMQOAoO"
}
}
],
Have another read of the Links page on Contentful Developer Documents.
Contentful Developer Documents - Links
to get a relationship link into the json you are requesting then you change the request link slightly as documented. instead of using the entryID where you have it after the entries/ in your link in the question, use it as demonstrated below.
https://cdn.contentful.com/spaces/oc3u7dt7mty5/entries?access_token=6cabb22c95d52aa7752fe70ae9b3271a1fc2decf7ae7d99ccd7dceba718980e6&content_type=3HjHXUYR3yyosUqAGmi8wu&fields.restaurantField.sys.id=2UmoQ8Bo4g4S82WmGiQIQE
It's been moved into the sys.id at the end of the URL.

How to use find function in YUI3? And how to find meta tag list?

Like jQuery we can collect the array of matched DOM element of class 'anything'
with the help of 'find' function
Can i have same functionality in YUI3?
Edit 1:
As i have website source code with the help of php 'file_get_content' function
and i want to find the list of meta tag by YUI3.
Here i used module named
1. io-base : to get the website source code in ajax mode
2. node : to implement functionality over code.
May i know how to parse the responseText to get the list of meta tag?
You can find the collection of all matched elements like this.
YUI().use('node', function(Y){
var myElements = Y.all('.classname');
});
If you are using the io module the user guides may help.
if the format of your response is something like json, you would include the json module and parse the responseText to json and then just treat it as an object. If it's xml that you get back use the responseXML returned via the io call and use the native xml dom functions. (The examples linked on the user guide shows just this type of work)
Also, if you are used to jQuery try the rosettastone site

couchdb cloudant form POST returns error bad

BACKGROUND:
https://cloudant.com/for-developers/all_docs/ under "Query by Post" says
"You can also query for a specific set of keys by POSTing a JSON array of keys to the view."
PROBLEM:
When attempting to query by POST in an HTML form, the result is an error
{"error":"bad_request","reason":"invalid UTF-8 JSON"}
(see e.g., http://jsfiddle.net/dreftymac/TPb7P/ )
QUESTION:
Are the docs on this just not up to date? or is there a reason why POST form submissions produce this error ?
How would one troubleshoot this ?
Cloudant accepts HTTP PUT requests with JSON in body. I do not think that HTTP POST with multipart/form-data will work. More information can be found here: http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API

Resources