1

I have to call SP search Api for documents in document Library applying filter for only bring such documents which are published and having specific content type .

Is there any specific property for the items in document library which determines whether the document is Published Or not using javascript .

1 Answer 1

2

I think what your looking for is this:

using rest

var value = SP.File.get_checkOutType()

https://msdn.microsoft.com/en-us/library/office/jj244900.aspx

https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.checkouttype.aspx

Example

$.ajax({url: "/_api/web/getFileByServerRelativeUrl('" + pageUrl + "')/checkOutType", headers: { "Accept": "application/json; odata=verbose" }, success: function(data) { switch(data.d.CheckOutType) { case 0: console.log('The file is checked out for editing on the server.'); break; case 1: console.log('The file is checked out for editing on the local computer.'); break; default: console.log('The file is not checked out.'); } } }); 
2
  • how can i use it in query string for search api which gives me only published documents Commented Nov 25, 2015 at 10:10
  • ok, what do you want to do with the result? if you want to simply display the data based on a query why not use a filer app c-sharpcorner.com/UploadFile/396c42/… or do you want to specifically use the search JS api as your using the data elsewhere? Commented Nov 25, 2015 at 14:33

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.