api for document view

cancel
Showing results for 
Search instead for 
Did you mean: 
aishu
Active Member

Re: api for document view

Dear @adelaidenx 

If i remove status from url then also same output is displayed.

 

 

harsh_thakkar
Active Member

Re: api for document view

Hii @aishu 

You can use out-of-the-box API for Get Content : 

/alfresco/s/api/node/content/{store_type}/{store_id}/{id}?a={attach?} which will gets the content stream of specified document.

where store_type=workspace,store_id=SpacesStore

id is node_uuid of document that you want. and a is boolean parameter if a=true then it will download your content and if a=false then if document is pdf or image you can see preview of that document on browser.

 

Regards,
Harsh | ContCentric
aishu
Active Member

Re: api for document view

Hi @harsh_thakkar ,

Thank you for your response.

we are trying to capture view share public link without authentication.

example- http://alfresco.domain.com:---/share/s/lkZtI9VIQOmelK9--EmFJg

could you please sugegst us how can we get this document/node ref id from database using query.

 

Thank you!

Kind Regards,

Aishu

harsh_thakkar
Active Member

Re: api for document view

Hello @aishu 

For view share public link you need to share that document so later you can get sharable link as you showed.

So for creating shared link you need to call API which will give you sharedId and after that you can add that sharedId in the format http://alfresco.domain.com:---/share/s/{sharedId} to access view without authentication.

For creating shared link please refer https://api-explorer.alfresco.com/api-explorer/#!/shared-links/createSharedLink .

In this API you need to pass nodeId of node that you want to view share public link and in response you will get sharedId.

Or you can also use following API which also returns sharedId and take parameters for particular node.

POST /alfresco/s/api/internal/shared/share/{store_protocol}/{store_id}/{node_id}

Regards,
Harsh | ContCentric
aishu
Active Member

Re: api for document view

Dear @harsh_thakkar,

Thanks for the response.

I have tried the api as you have mentioned in the previous mail.

http://alfresco.domain.com/alfresco/api/-default-/public/alfresco/versions/1/shared-links?skipCount=...

but we are getting only 29 records as result.

Is there is api based on site filter? so we get share id of all document from particular site?

kindly suggest on this!

 

Kind Regards,

Aishu.

harsh_thakkar
Active Member

Re: api for document view

@aishu 

I think you have used that "List shared links" API which will returns records of all documents that are shared.

You got only 29 records as result because only those number of documents are shared.

So either you have to share documents through interface or through API which I have provided to you "Create a shared link for file" then you will get maximum records.

And I am not sure about site filter in that "List Shared links" API.

You can check at https://api-explorer.alfresco.com/api-explorer/#!/shared-links/listSharedLinks for more information.

Regards,
Harsh | ContCentric