REST API Query for file Versions - current version

Hi,
I have referred to the list of API query options from this link:
https://msdn.microsoft.com/en-us/library/office/dn450841.aspx .
As described in the post, the query  goes as below
url: "<app web url>/_api/SP.AppContextSite(@target)/web
    /getfilebyserverrelativeurl('/Shared Documents/filename.docx')/versions
    ?@target='<host web url>'",
This does not return the current file version details. Is there a way to get those details in the same query or should we place another query to get the current version file details as below
url: "<app web url>/_api/SP.AppContextSite(@target)/web
    /getfilebyserverrelativeurl('/Shared Documents/filename.docx')
Thanks,
Meena

Hi Meena,
In FileVersion endpoint, it will only return the old versions of a file.
If you want to retrieve all versions(including) of a file, there will be a need to run another request for the current version only, though which might cause extra workload.
Thanks
Patrick Liang
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]

Similar Messages

  • REST API: Query for object based on name instead of objectId

    Please correct me if I'm wrong...
    Right now I have to query anything and everything by the objectId. The issue is that I don't know what that is. I know the name. So, for example, If I know the objectId of an edge device named "myrouter" is "edge-1", then I can do:
         https://nsxmgr/api/4.0/edges/edge-1
    Awesome! Now I get the entire config. But let's say I don't know the edgeId. Because why would I? I would, however, know its name because that's why I name things. In many other API's all I would have to do is something like this:
         https://nsxmgr/api/4.0/edges?name=myrouter
    The only way I know of to do this today is to fetch ALL of the edges with the following:
         https://nsxmgr/api/4.0/edges
    This returns every single edge in the scope! Then I have to do something like (in powershell):
         $router_exist = (Select-Xml -Xml $script:edges -XPath "//edgeSummary[name=`"$esr_name`"]").Node
         if ($router_exist) {
              $router_id = $router_exist.objectId
    This isn't just for edges...its for every object available. Is it not possible to query based on an attribute?
    Thanks,
    Daniel

    Thanks for the replies :-)
    However my issue is that it gets loaded in a wrong format.
    In our System OU Name is shown as "COMPUTERS"; "DK"; "123dom" - Instead of 123dom/DK/Computers.
    We cannot make collections quering for OU name with this format in SCCM 2012. Has anyone seen this issue before? The forest was discovered using AD Forest+System+User discovery.

  • Should i upgrade to IOS 8.3 for IPAD2. my current version is 7.1.2

    should i upgrade to IOS 8.3 for IPAD2. my current version is 7.1.2 and ipad2 is 64gb,wifi +3g

    Do not do it! I just recently upgraded. My ipad 2 is super slow. All the efforts to speed it up/optimize didn’t help much. iPad 2 doesn’t have enough memory and cpu is not powerful enough to handle ios 8. Apple made bad call releasing it (or the intention was to brick old hardware so people go to stores to buy newer hardware). To make matters worse iOS 8.3 is very unstable – my ipad kept crushing very frequently – something I never saw before. Thank god I was able to revert to 8.2. I spent countless hours trying to downgrade to 7.1.2 only to learn that it’s impossible. I even went to Apple store to ask for help with downgrading but they just said what I already knew – it was impossible. Just like mdiamond58 said if I could downgrade to 7.1.2 I would do it in a heartbeat. Thank you Apple for changing my iPad into paper weight.

  • REST API available for CCW?

    Hi Experts,
    I want to develop a web application interfacing CCW. Is there an REST API available for CCW?
    Thanks
    Krishna

    Hi, do Cisco provide a REST API for accessing the CCW in the meantime?

  • Query for file version less than 10.0 does not return expected data

    I'm trying to build a query for all PCs that have a version of Iexplore.exe in c:\windows\program files\ that is less than 10.0 .  When I run the query it returns no data. When I change 10.0 in the query to 9.9 it returns files with version 10.xxx in
    the results.  Its as if it is seeing 10.0 as 1.0.   Is this expected ?
    select SMS_R_System.Name, SMS_R_System.ADSiteName, SMS_G_System_SoftwareFile.FileName, SMS_G_System_SoftwareFile.FileVersion from  SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where
    SMS_G_System_SoftwareFile.FileName = "iexplore.exe" and SMS_G_System_SoftwareFile.FilePath = "C:\\program files\\internet explorer\\" and SMS_G_System_SoftwareFile.FileVersion < "9.9"

    It is because the values are not integer, they are a string. And therefore 1 is smaller then 9.
    http://www.enhansoft.com/

  • SCCM query for file path

    For some reason, I am unable to get a query to work for an exe located at a specific file path.  I can do a query for the exe itself and get more results than I want, but I need to find it in a specific path.  
    The path and file name is: c:\Program Files\NBSI\sysdll\sysserv.exe.
    Thanks!

    Hi John,
    when i tried to find a file at path like dbo.v_GS_SoftwareFile.FilePath ='c:\windows\'
    No result found.

  • Using REST API: Query search box to return list items

    Hey,
    My goal is to create a search box which returns the items (matching to the name) from a list.
    Bonus: The return would happen without requiring user to click a
    Search button or such.
    To achieve this I assume the SharePoint 2013's REST API should be used. I'm completely inexperienced in using the REST API so all kind of suggestions are available.

    Hi,
    Here are some articles about SharePoint 2013 REST API for your reference:
    Get started with the SharePoint 2013 REST service
    http://msdn.microsoft.com/en-us/library/office/fp142380(v=office.15).aspx
    How to: Complete basic operations using SharePoint 2013 REST endpoints
    http://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    SharePoint 2013 – CRUD on List Items Using REST Services & jQuery
    http://www.plusconsulting.com/blog/2013/05/crud-on-list-items-using-rest-services-jquery/
    Working with SharePoint list data - OData, REST and JavaScript
    http://blogs.technet.com/b/fromthefield/archive/2013/09/05/working-with-sharepoint-list-data-odata-rest-and-javascript.aspx
    Best regards
    Dennis Guo
    TechNet Community Support

  • Batch Rest API Upsert for CDO Field Limit?

    Currently with SOAP we can update 150 CDO fields at once, is there a 100 filed limit with Batch Rest API?

    Further to Corey's question, when using REST API, when we upsert more than 100 fields into a CDO we get an error stating that we can only update 100 fields. Is it possible to change this limitation with Bulk REST API so that we can update more than 100 fields?

  • REST API Wrapper For SP

    Hi,
    I am planning to create Service based custom wrapper for sharepoint using the REST API  for my developers so fetching and basic operations becomes easier for them. it turns out that in REST API/Web Services I am supposed to pass the credentials as well.
    and since i can not pass the default credentials in my service which is out side the SharePoint environment. it will be difficult to pass the authentication. I have also thought of doing the operations using 1 single credential. But in that case all my list/document
    library etc. has that user signature in created by and modified by columns on sharepoint.
    Any suggestion ?
    Thanks, Parth

    Hi Shay,
    Thanks for reply i followed the steps given in the documents, but there is a authentication problem.
    1.I am able to see the services available in the API ----> http://host:port/rest/api/resourceIndex
    These are some of the rest services  http://host:port/rest/api/spaces/resource/templates?utoken=FAOfyLL32piL7dPu9tXJjoEFMC5n_w**
                                                          http://host:port/rest/api/spaces?utoken=FAOfyLL32piL7dPu9tXJjoEFMC5n_w**
    My question is , Are these the correct services which i need to consume in Jdeveloper (URL Service Data Control).
    While consuming these services i m getting the error like "Authentication is Required". Is it the correct way to consume these services ??.
    If not could you please tell me how to resolve this issue..? help me in this..
    Thanks.

  • Collection query for specific SCCM client version - Parameters?

    Good morning,
    I need to upgrade my older clients as I recently upgraded SCCM to SP2.  I can't seem to find the parameters in query builder to populate a collection with a specific SCCM client version.  Can anyone help me out or point me in the right direction?  I can't find anything using "The Google".  You'd think lots of people would want this that there'd be a default query in SCCM already.  Thanks.

    Here is a query of all clients running sp1 version:
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_SMS_ADVANCED_CLIENT_STATE on SMS_G_System_SMS_ADVANCED_CLIENT_STATE.ResourceId = SMS_R_System.ResourceId where SMS_G_System_SMS_ADVANCED_CLIENT_STATE.Version = "4.0.6221.1000"
    JonL

  • How to use search REST api to get custom managed property data for anonymous user?

     
    I am trying build a public portal with anonymous access and i am trying to read some
    content from custom managed property using search REST api in sharepoint 2013. I have tried to enable all possible attributes of the managed prop. Like searchable,queryable,safe etc. also i am including queryparametertemplate in my REST api search query. But
    still i am not able to retrieve the managed prop. For an anonymous user. The same query returns the value if i am logged in.
    Any Help is greatly appreciated. 
    Thanks,
    Rakesh
    Thanks, Rakesh

    Hi Rakesh,
    To enable anonymous Search REST queries, we need to create queryparametertemplate.xml and upload it to the correct library in SharePoint.
    From your description I can know that you have created the file, then I recommend to check the things below:
    Please use “QueryTemplatePropertiesUrl” instead of “queryparametertemplate” in the Search REST API query as following: &QueryTemplatePropertiesUrl='spfile://webroot/queryparametertemplate.xml'.
    Make sure that the Query Properties you need have been added to the QueryProperties element in the queryparametertemplate.xml file.
    Make sure that the query parameters you need have been added to the WhiteList element in the
    queryparametertemplate.xml file. For example, if you want to use Refiners in the REST API, then the Refiners should be added to the
    WhiteList element in the queryparametertemplate.xml file as following:
    <a:string>Refiners</a:string>.
    You can also debug setting properties in anonymous Search Rest queries following the link below:
    http://www.mavention.com/blog/debugging-setting-properties-anonymous-search-rest-queries
    More references about anonymous Search REST:
    http://blog.mastykarz.nl/configuring-sharepoint-2013-search-rest-api-anonymous-users/
    http://msdn.microsoft.com/en-us/library/office/jj163876%28v=office.15%29.aspx#bk_AnonymousREST
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Are there REST APIs to retrieve entity metadata for  eloqua objects?

    There is a list of all the objects which can be accessed by REST for CRUD in this link: REST API - Documentation for Core Objects under the Core Objects section.
    For each of the objects listed under the  Core Objects section are there is a field metadata under the Properties section.
    For example for Email object, REST API - Accessing Emails , under the Properties section, there corresponding entries for fields of Emails object under the
    Name ,Type, Description and Validations headings.
    Is there a REST API for retrieving the same information i.e. the field metadata for an eloqua object programmatically ?
    If not , it is a serious hindrance to building systems that are metadata driven and also since SOAP support is being deprecated...

    Metadata is 'top level' information on the object, and available whether you query the individual object (a single form, or email asset) or query for multiple objects of that type (list all forms, list all emails). Consider using a depth of minimal or partial for faster performance if the specific configuration of those objects is not important..
    Example:
    GET /assets/forms?depth=minimal&count=2
    Returns:
      "elements":
        "type":"Form",
        "currentStatus":"Draft",
        "id":"19",
        "createdAt":"1409623550",
        "createdBy":"8",
        "depth":"minimal",
        "folderId":"7",
        "name":"zzztestCS_3-9381543541_AutocompleteTest",
        "permissions":"fullControl",
        "updatedAt":"1409623623",
        "updatedBy":"8"
        "type":"Form",
        "currentStatus":"Draft",
        "id":"22",
        "createdAt":"1409781207",
        "createdBy":"11",
        "depth":"minimal",
        "folderId":"466",
        "name":"daisychain1",
        "permissions":"fullControl",
        "updatedAt":"1412779449",
        "updatedBy":"20"
      "page":1,
      "pageSize":2,
      "total":130
    Without limiting the count to 2, this would return up to 1000 results if you had multiple forms in your system and give you a basic top level view of each. Similarly, you can use GET /assets/form/{id}?depth=minimal to get the same sort of information.
    Other endpoints can be found on the REST livedocs page here (requires authentication):
    https://secure.eloqua.com/api/docs/Dynamic/Rest/1.0/Reference.aspx
    Regards,
    Bojan

  • FILES REST API url to list specific folder content

    I need to retrieve the items/documents in a specific folder of our Office 365 hosted SharePoint site, but I always get an resource error. I'm trying to use the FILE REST API for this, documented here:
    https://msdn.microsoft.com/office/office365/APi/files-rest-operations
    The url to the SharePoint site with the files is
    https://informationresourcemanager.sharepoint.com/irm/fido/1074/Forms/AllItems.aspx
    and according to the MSDN documents the call should be
    GET {base-url}/Files/{folder-id}/children
    and "base-url" should in the case of SharePoint be
    https://{tenant}.sharepoint.com/{site-path}/_api/v1.0
    Now, I've tried 10 different combinations without getting any good results, so I guess I'm doing something wrong with the base-url or the site-path. Is the correct base-url this for my site
    https://informationresourcemanager.sharepoint.com/irm/fido/_api/v1.0/
    or just
    https://informationresourcemanager.sharepoint.com/irm/_api/v1.0/
    /Johan

    Hi,
    According to your description, my understanding is that you want to get all the content in a specific folder using Office 365 rest api.
    For the base url, it needs to specify the site collection name in the url. In my environment, I have a site collection called "ZhengyuGuo", so we can get all the file in such site collection like below firstly:
    https://xxx.sharepoint.com/sites/zhengyuGuo/_api/v1.0/files/
    Then you can get the content in a specific folder using the "getByPath" method like below, in my environment, I will get the all file contents in document library folder.
    https://xxx.sharepoint.com/sites/zhengyuGuo/_api/v1.0/files/getByPath('/')/children
    The json data return like the capture below:
    Thanks
    Best Regards,
    Jerry Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Which Objects should I target for integrating Eloqua REST API 2.0?

    Which Objects should I target for integration? and What are the possible use cases for the additional objects other than core objects?

    I am still trying to find a good REST API 2,0 document like the Bulk 2.0 document.  Book List: Oracle Marketing Cloud
    I did find this but is also not in depth:
    REST API - Documentation for Core Objects

  • REST API for CCW

    Hi,
    Is there a REST API available for CCW operations? 
    Thanks
    Krishna

    Hi, do Cisco provide a REST API for accessing the CCW in the meantime?

Maybe you are looking for

  • FA Acquisition - 21151: error while posting asset document: '100000006'

    Hi All, When I was performing the FA Acquisition for a fixed asset code, the above error message prompt. I am using SAP B1 8.8 PL 15. Before this error appear, I was able to perform all other transactions like FA Acq, Credit Note, Retirement and depr

  • File transport on business service

    We have a messaging flow in OSB 10gR3 that read a message from a JMS queue and puts the file in an directory on an IBM AIX platform. There have been some problems with the OSB not able to rename the files from example.xml.a to example.xml due to the

  • I need help getting flash to work on my computer

    I've installed, deleted, reinstalled, but nothing works mac os X 10.9.1 about 14 months old all other software from adobe runs fine just don't know what to do next

  • How I know my iphone model was real 3GS?

    I bought my iphone last a month but *now days I realized that my model was MC131B verson 3.1.3(7E18)* setting on the phone . *my question is , what really does my iphone model is?* When I bought this iphone the salesman told that was Iphone 3GS. I'm

  • Odd lines around text in dissolve

    Hi Folks, I have been experiencing some odd lines around text when I am dissolving and can't figure out why. The text is generated from FCP and these lines only appear after rendering. Prior to rendering I can step through the dissolve and all is wel