Add children using REST API in firebase - firebase

Hey I have a dataset uploaded in the following form:
SomeKey
-> Alphabet
-a: "['apple', 'ant']"
-b: "['ball', 'bat']"
Now using Rest API, I want to add new children to the object 'Alphabet'. Now if I use POST it inserts a new random key as a child to Alphabet and PUT at https://gamma.firebase.com/SomeKey overwrites the current data completely. How to insert a new child using the REST API?

You can address the children directly by URL.
If you wrote "a" and "b" originally to:
/SomeKey/Alphabet
And then wanted to add "c" later, you can just send a PUT request to:
/SomeKey/Alphabet/c
Additional details about the REST API are here:
https://www.firebase.com/docs/rest-api.html

Related

Understand Dynamic Links Firebase

I would like to understand better Firebase Dynamic Links because i am very new to this subject.
What i would like to know :
FirebaseDynamicLinks.instance.getInitialLink() is supposed to return "only" the last dynamic link created with the "initial" url (before it was shorten) ?
Or why FirebaseDynamicLinks.instance.getInitialLink() doesn't take a String url as a parameter ?
FirebaseDynamicLinks.instance.getDynamicLink(String url) doesn't read custom parameters if the url was shorten, so how can we retrieve custom parameters from a shorten link ?
My use case is quite simple, i am trying to share an object through messages in my application, so i want to save the dynamic link in my database and be able to read it to run a query according to specific parameters.
FirebaseDynamicLinks.instance.getInitialLink() returns the link that opened the app and if the app was not opened by a dynamic link, then it will return null.
Future<PendingDynamicLinkData?> getInitialLink()
Attempts to retrieve the dynamic link which launched the app.
This method always returns a Future. That Future completes to null if
there is no pending dynamic link or any call to this method after the
the first attempt.
https://pub.dev/documentation/firebase_dynamic_links/latest/firebase_dynamic_links/FirebaseDynamicLinks/getInitialLink.html
FirebaseDynamicLinks.instance.getInitialLink() does not accept a string url as parameter because it is just meant to return the link that opened the app.
Looks like there's no straightforward answer to getting the query parameters back from a shortened link. Take a look at this discussion to see if any of the workarounds fit your use case.

Alfresco REST API for downloading document

I want to use the Afresco REST API to download a document. After some research I find out this REST API:
/alfresco/s/api/node/content{property}/{store_type}/{store_id}/{id}
But I am not sure how to pass the parameters.
If my document details URL in Share is :
http://127.0.0.1:8080/share/page/context/mine/document-details?nodeRef=workspace://SpacesStore/7f77488a-60a0-48c3-9369-77183ccad0d2
What should be passed in {property}, {store_type}, {store_id} and {id}?
For this NodeRef
workspace://SpacesStore/7f77488a-60a0-48c3-9369-77183ccad0d2
the values for parameter will be:
{property}: content
{store_type}: Workspace
{store_id}: spaceStore
{id}: 7f77488a-60a0-48c3-9369-77183ccad0d2
Details related to each parameter is already specified by Krutik.
And you should use this download url.
/alfresco/d/<d|a>/<workspace>/<store>/<nodeId>/<filename>
where d=direct and a=attached.
The attach or direct element is used to indicate whether to display the stream directly in the browser or download it as a file attachment.
You can find details of every web-script (REST API) in alfresco on below URL.
http://localhost:8080/alfresco/service/index
For your API it is given as below.
http://localhost:8080/alfresco/service/script/org/alfresco/cmis/content.get
Description of parameter is as below.
Property : Name of property which you want to retrieve.
store_type : Workspace Protocol
store_id : Store Id of node
id : Id of node.

StructureGroup Details using the Content Delivery/Broker API

I am trying to get all the structure groups published in a given publication using the PublicationID. I am expecting to get the structure groups with StructureGroupCriteria by passing the Root Structure Group TCM ID but getting page ids (I am expecting SGs).
Now I am trying to loop through the list and get details of each structuregroup. I did not find any API (.net) to get these details and also the API is returning only Pages.
What I have done and working so far using StructureGroupCriteria, returns list of Page IDs instead of SG IDs
PublicationCriteria pubCriteria = new PublicationCriteria(pubID);
// Root StructureGroup TCM ID -- tcm:45-3-4
StructureGroupCriteria sgCriteria = new StructureGroupCriteria("tcm:45-3-4", true);
Criteria allSGsInPub = CriteriaFactory.And(pubCriteria, sgCriteria);
Query allSGs = new Query(allSGsInPub);
string[] sgInfo = allSGs.ExecuteQuery();
Response.Write("Total : " + sgInfo.Length);
foreach (string sgid in sgInfo ) {
// HOW DO I get the Structure Group Details here
//TCMURI sgURI = new TCMURI(sgid);
}
Q # 1 : How to get the all the structuregroups and individual structure group details? (May be something simple, I am not able to find right API).
Q # 2 : How can I get all the structuregroups using ItemTypeCriteria sgCriteria = new ItemTypeCriteria(4); // 4 is SG Item Type .
When I tried this option, the query worked successfully but no results returned. Is this the expected behavior and should we always use StructureGroupCriteria instead of ItemTypeCriteria?
The reason for this approach, I want to avoid using the Root StructureGroup ID which is required with the above code. But at the moment, none of the approaches returning StructureGroup information and I always get Page Information.
Tridion Version: 2011 SP1, .net API.
Note: When I publish I am checking the publish SG info checkbox and published successfully. On Broker DB side, I can see the information on the taxnonomy table as well.
I was playing with Odata service and accidentally I found that I can get all my structure group information from Odata web service.
/cd_webservice/odata.svc/StructureGroups?$filter=PublicationId%20eq%2045
Also, the results are returning child structure groups with a depth parameter.
Just to clarify , using Broker API it is not feasible to get the structure groups (my original question). However, the workaround solution is to use OData Service to get the Structure Groups.
I don't think you will get Structure Groups returned by the Query object.
According to the documentation, when you publish Structure Group information the Structure Group hierarchy is published to the Content Delivery side where it is stored as a taxonomy.
Have you tried using the Taxonomy APIs to get the information you need?

Exchange Server Webdav: How to retrieve the unique id of new items created

I am creating the appointments using WebDav in Exchange server 2003 and it is working perfectly fine. I however want to get an handle for the newly created items for future user like setting custom property/deleting etc.
How to get back a unique ID or something for the newly create the appointment? Does the PROPPATCH return any value??
Thanks
Shreedhar
When you create new item server returns MultiStatus. Inside MultiStatus response is item's url. Keep this url for later use (to delete/update item).
http://msdn.microsoft.com/en-us/library/aa142976(v=exchg.65).aspx
There is also a library with clean design from Independentsoft which implements WebDAV protocol for Exchange. It also returns item's url when you create new item.

Google reader API get single item

I am trying to retrive a single selected item from the google reader api. Is there an api call I can make to get an item by Id or do I have to access that items feed and get it from there?
You can use POST to http://www.google.com/reader/api/0/stream/items/contents using i= as the input (you can repeat the i= parameter to get multiple item contents).
Here's a sample curl invocation:
$ curl -d "i=tag:google.com,2005:reader/item/1bab1bbe8a8ad82f" http://www.google.com/reader/api/0/stream/items/contents
{"direction":"ltr","id":"feed/http://googlereader.blogspot.com/atom.xml","title":"Official Google Reader Blog","description":"News, tips and tricks from the Google reader team.","self":[{"href":"http://www.google.com/reader/api/0/stream/items/contents"}],"alternate":[{"href":"http://googlereader.blogspot.com/","type":"text/html"}],"updated":1275437593,"items":[{"crawlTimeMsec":"1275437593933","id":"tag:google.com,2005:reader/item/1bab1bbe8a8ad82f","categories":[],"title":"Folder and tag renaming",
The output format is JSON by default, you can add a output=atom parameter to switch it to Atom.

Resources