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

Similar Messages

  • How to access search service api to get results in JSON format?

    How to access search service api to get results in JSON format in asp.net web application outside SharePoint farm. It should be an app or SharePoint hosted.
    I have tried the same with the help of "http://dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/04/09/how-to-query-sharepoint-2013-using-rest-and-javascript.aspx".
    function onQuerySuccess(data) {
        var results = data.d.query.PrimaryQueryResult.RelevantResults.Table.Rows.results;
        $("#resultsDiv").append('<table>');
        $.each(results, function () {
            $("#resultsDiv").append('<tr>');
            $.each(this.Cells.results, function () {
                $("#resultsDiv").append('<td>' + this.Value + '</td>');
            $("#resultsDiv").append('</tr>');
        $("#resultsDiv").append('</table>');
    But we are getting data.d as undefined.
    I have checked and verify that I am getting success and data in XML format not in JSON. As I expected the JSON. Although I have specified the "JSON" in headers " headers:
    { "Accept": "application/json;
    odata=verbose" } ". 
    Thanks

    Hi,
    Per my understanding, you might want to access search service REST API and get results in JSON format using jQuery.
    The code you use is working in a SharePoint Hosted App project, to compose a working code snippet easier, you can take the demo below for a try:
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">
    _spBodyOnLoadFunctionNames.push("ready");
    function ready()
    var spAppWebUrl = _spPageContextInfo.webAbsoluteUrl;
    var queryUrl = spAppWebUrl + "/_api/search/query?querytext='book'";
    $.ajax({
    url: queryUrl,
    method: "GET",
    headers: { "Accept": "application/json; odata=verbose" },
    success: function (data) {
    console.log(data);
    var results = data.d.query.PrimaryQueryResult.RelevantResults.Table.Rows.results;
    $.each(results, function () {
    $.each(this.Cells.results, function () {
    console.log(this.Key+"--"+this.Value);
    error: function (data) {
    console.log(data);
    </script>
    Add the code into a page of your site, it will retrieve JSON format data and print the search result in the console of browser.
    More information about how to work with SharePoint Hosted App:
    https://msdn.microsoft.com/en-us/library/office/fp142379.aspx
    If you want to call the search service REST API in a remote environment, authentication is required to be taken into consideration, the link below with a working demo
    would be helpful:
    https://pholpar.wordpress.com/2013/05/11/accessing-office-365-sharepoint-sites-using-rest-from-a-local-html-javascript-host/
    Best regards
    Patrick Liang
    TechNet Community Support

  • REST API to get and update Task Data

    On CPSC 9.4.1 R2, I am unable to find any REST API operation to get and update task data details (all the service form and dictionary fields).
    Task operations only return limited task meta-data not the details of the task/requisition data submitted, fields, etc.
    Does anyone know if such thing exist?
    Thanks.

    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

  • How to use WebCenter REST API to like or comment a activity

    Hi all
    I want to know how to realize like or comment function with REST APIs.
    I execute a REST call with following url, but the 'like' counter is not be increased.
    http://cdcjp77vm3.cn.oracle.com:8888/rest/api/activities/services/oracle.webcenter.community/objectTypes/groupSpace/objects/(s2518c69b_1989_4a63_8886_c32075c76b9c)/likes?&utoken=FDNA-Z7ekZuPnVSNoPWOqTJ2IzAE_w**
    Is there anything i missed?
    Can anyone give me an example about how to use this API to like or comment a activity?
    Thanks
    Qian

    So Qian;
    looking through the code this is how you can
    Post a comment (POST)
    /rest/api/activities/services/{serviceId}/objectTypes/{objectType}/objects/({objectId})/comments?startIndex={startIndex}&itemsPerPage={itemsPerPage}&utoken=blah
    {key:val}
    {text:'this is my comment)
    Edit a comment (PUT)
    So I haven't tried it but it should do the trick.. although I don't see update under capabilities so you may get blocked.
    /rest/api/activities/services/{serviceId}/objectTypes/{objectType}/objects/({objectId})/comments?startIndex={startIndex}&itemsPerPage={itemsPerPage}&utoken=blah
        id: {commentId},
        text: 'changed my comment.. magic'
    Delete a comment (DELETE)
    /rest/api/activities/services/{serviceId}/objectTypes/groupSpace/objects/({objectId})/comments/{commentId}?utoken=blah
    Like POST
    /rest/api/activities/services/{serviceId}/objectTypes/{objectType}/objects/({objectId})/likes?startIndex={startIndex}&itemsPerPage={itemsPerPage}&utoken=blah
    I passed it an empty object {} seemed to work for me.
    Unlike (DELETE)
    /rest/api/activities/services/oracle.webcenter.community/objectTypes/groupSpace/objects/({objectId})/likes/({likeId})?utoken=blah
    Let me know if this works for you

  • Query a document library using Search Rest API

    How can we search for a specific document library using SharePoint Search through Rest API? We have a couple of document libraries which have thousands of documents with its relevant metadata information stored. We need to create an app to search through
    these document libraries and display the document and its metadata. Can someone point me in the right direction?
    V

    Taking what Shakir said you would substitute queryText with a managed property query (KQL) to query against metadata from the Document library. So if your document library has a Owner column then you would either create or use an existing managed property
    defined in the Search Schema. So your query may look like this:
    https://<site URL>/_api/search/query?querytext='(owner:smith)+AND+(path:<library url>)'
    Link:
    https://msdn.microsoft.com/en-us/library/office/ee558911.aspx?f=255&MSPPError=-2147217396
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • How to retrieve the users that are following a document using JSOM / REST APIs in SharePoint 2013

    Hi everyone,
    Does anyone know how to use JSOM / REST APIs to retrieve the users that are following a specific document in SharePoint 2013? 
    Thanks in advance,
    Nam

    Hi Nam,
    Please use the sample code to get the followers for the document. Courtesy: Mokhtar
    Bepari 
    using Microsoft.SharePoint.Client;
    using Microsoft.SharePoint.Client.Social;
    ClientContext clientContext = new ClientContext("http://URL");
    SocialFollowingManager followingManager = new SocialFollowingManager(clientContext);
    SocialActorInfo actorInfo = new SocialActorInfo();
    actorInfo.ContentUri = "<documenturl>"; //set the document url.
    actorInfo.ActorType = SocialActorType.Document;
    //By using the GetFollowed method you can get the people who the current user is following.
    ClientResult < SocialActor[] > followedResult = followingManager.GetFollowed(SocialActorTypes.Users);
    //By using the GetFollowers() method you can get the people who are following the current user.
    ClientResult < SocialActor[] > followersResult = followingManager.GetFollowers();
    clientContext.ExecuteQuery();
    Once you get the resultset you can iterate like below:
    foreach(SocialActor actor in followedResult)
    string name = actor.Name;
    string imageURL = actor.ImageUri;
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Person search to metadata field with search REST API on SP2013 online

    Hi!
    I'm developing a sandbox solution to be deloyed on SharePoint 2013 online. This solution contains a web part for a custom functionality. I have a need to make a query against data in user profiles based on two custom metadata properties (mapped to termsets).
    Is it possible to create this kind of query by using search REST API (with javascript)? So I need all persons whos metadata field
    MyOwnTerms contains specific value(s) passed to search?
    I can get all users with /_api/search/query?querytext='*'&sourceid='B09A7990-05EA-4AF9-81EF-EDFAB16C4E31'very (if i set the rowlimit to very high) and the results contains my cystom field
    MyOwnTerms but there is too much of results to loop through just for filtering. I cannot reduce rowlimit because I need ALL the persons with certain metadata value in this field. Is there any way to make this work?
    .Ana

    I went through the same problem and yes it is possible. In my case, I created a Managed Properties specific to my site column metadata, and assign the value only the label of the column metadata for this managed property. So it returns only the value of
    the name and not the metadata ID | Name as the default. 
    So, just move on selectproperties the name of your managed metadata, so it returns the correct value.

  • How to create a campaign based on a template using the REST API

    Hi CodeIt-ers,
    I'm using the REST API to create campaigns in Eloqua 10, all works well except for 1 thing: I can't seem to create a campaign based on an existing Campaign template.
    Based on the documentation on REST API - Accessing Campaigns I've tried using "sourceTemplateId" (code snippet below) but that did not do the trick.
    Does that functionality simply not work or am I missing something?
    Thanks!
    Ferry
    $campaign_data = new Campaign(); 
    $campaign_data->sourceTemplateId='442';
    $campaign_data->folderId='1137';
    $campaign_data->currentStatus='draft';

    Hi Richard,
    Unfortunately no. I reached out to support, they informed me "sourceTemplateId" could not be used to create new campaigns based on a template, instead they advised to use the "Elements " property as shown in this example: Eloqua REST API - Create a Campaign with a Segment and Email
    Thanks
    Ferry

  • Capturing Hosts,cluster,ad Resource information of hosts using SPF REST API

    Hi,
    We are using SCVMM 2012R2 to integrate Hyper-V VMM with java using SPF REST API.For this I am using tenant API. 
    I am able fetch all the entities in VMM using GET query in SPF URL,but I am unable to fetch hosts,cluster and resource information for hosts.
    Can anyone please tell me how will I fetch this information with REST API or does there any other way exists.
    If so please tell  me with the example.
    Thank you.

    Hi ,
    SPF only covers Tenant actions and information. There is no information about hosts and clusters that can be get from SPF.

  • Search REST API - Usage reports

    Hi,
    We use the Search REST API to execute queries. 
    The Usage reports on the Site Collection under Popularity and Search Reports do not contain any data.
    Is there a way to get usage data for queries executed by the REST API?
    Best regards,
    Christoffer Vig

    You suggest running queries directly against the SP log database? I see it described at http://technet.microsoft.com/en-us/library/hh769359(v=office.14).aspx as well.
    I always thought this was strictly prohibited in a production environment and will void warranty, but is the logging database an exception to this?
    Thanks,
    Mikael Svenson
    Search Enthusiast - SharePoint MVP/MCT/MCPD - If you find an answer useful, please up-vote it.
    http://techmikael.blogspot.com/
    Author of Working with FAST Search Server 2010 for SharePoint

  • Using Parse REST APIs

    I know that you will recommend me to download
    Parse .Net SDK.
    But the problem is that it uses Tasks which are only available in .Net 4.5
    The older versions of .Net are not supported.
    That is why I am going to use parse REST APIs.
    Having a problem in understanding.
    Here is how to create parse object:
    https://parse.com/docs/rest#objects-creating
    curl -X POST \
    -H "X-Parse-Application-Id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "X-Parse-REST-API-Key: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" \
    -H "Content-Type: application/json" \
    -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
    https://api.parse.com/1/classes/GameScore
    I don't know how to add "-d" string(JSon) to the request.
    I tried and here is my code:
    Using client As New WebClient
    Dim values As New NameValueCollection
    values("X-Parse-Application-Id") = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    values("X-Parse-REST-API-Key") = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
    values("Content-Type") = "application/json"
    Dim response = client.UploadValues("https://api.parse.com/1/classes/GameScore", values)
    Dim str = System.Text.Encoding.Default.GetString(response)
    End Using
    And it is returning this error: (401) Unauthorized
    Allow time to reverse.

    But I got the answer and want to help the others.
    Dim request As WebRequest = WebRequest.Create("https://api.parse.com/1/classes/GameScore")
    request.Headers("X-Parse-Application-Id") = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    request.Headers("X-Parse-REST-API-Key") = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
    request.ContentType = "application/json"
    request.Method = "POST"
    Dim bytes = System.Text.Encoding.GetEncoding("UTF-8").GetBytes("{""score"":1337,""playerName"":""Sean Plott"",""cheatMode"":false}")
    Dim stream = request.GetRequestStream
    stream.Write(bytes, 0, bytes.Count)
    stream.Close()
    Dim response = request.GetResponse
    Dim stream2 = response.GetResponseStream
    Dim bytes2(response.ContentLength - 1) As Byte
    stream2.Read(bytes2, 0, bytes2.Count)
    stream2.Close()
    response.Close()
    Dim s = System.Text.Encoding.Default.GetString(bytes2)
    MsgBox(s)
    Allow time to reverse.

  • I recieved an Adobe Master Collection License number from my school (Stevens Institute of Technology) and I can't figure out how to use it in order to get the product. I've created a username and that's as far as I've gotten.

    I recieved an Adobe Master Collection License number from my school (Stevens Institute of Technology) and I can't figure out how to use it in order to get the product. I've created a username and that's as far as I've gotten. I need to download the product and I can't figure out where to begin.

    Ask someone at your school... Do you have a Cloud redemption code, or a CS6 serial number?
    If Cloud, Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html and
    http://www.adobe.com/products/creativecloud/faq.html
    http://helpx.adobe.com/creative-cloud/help/install-apps.html to install or uninstall
    http://forums.adobe.com/community/download_install_setup/creative_cloud_faq
    What it is http://helpx.adobe.com/creative-cloud/help/creative-cloud-desktop.html
    Cloud Getting Started https://helpx.adobe.com/creative-cloud.html
    If CS6, download at Other downloads and enter your serial number when prompted
    Again... your 1st resource is your school

  • How to use search term2 in customer master record

    hi
    how to use search term2 in customer master record. can anyone tell me plz
    thanks
    monica

    Hi,
    Search Term 2
    Label used for search helps.
    Only uppercase letters are stored in this field. Your entries are converted automatically to uppercase letters.
    There are two of these fields for search terms. These fields can be used independently of each other.
    Procedure
    You can use your own criteria for entering the search term.
    Example
    You can enter the main part of the name or an organizational ID.
    For example, for the company "Hechinger & Sons", you could enter "Hechinger" as the first search term.
    The second search term could then be the name ID you use within your company, to help you identify your data later.
    Please check out the following link:
    http://help.sap.com/saphelp_47x200/helpdata/EN/01/a9b331455711d182b40000e829fbfe/frameset.htm
    Hope this helps.
    Please assign points as a way to say thanks.
    Regards,

  • How to use search help in ECC6.0 reports without matchcode.

    How to use search help in ECC6.0 reports without matchcode.
    Select-options: O_SHIP FOR KUNWE MATCHCODE OBJECT DEBI  is in 4.6c.

    we can use on value request for that.
    report zrich_0001 .
    tables: t001.
    data: begin of it001 occurs 0,
    bukrs type t001-bukrs,
    butxt type t001-butxt,
    ort01 type t001-ort01,
    land1 type t001-land1,
    end of it001.
    select-options s_bukrs for t001-bukrs.
    initialization.
    select bukrs butxt ort01 land1 into table it001 from t001.
    at selection-screen on value-request for s_bukrs-low.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
    retfield = 'BUKRS'
    dynprofield = 'S_BUKRS'
    dynpprog = sy-cprog
    dynpnr = sy-dynnr
    value_org = 'S'
    tables
    value_tab = it001.
    start-of-selection.
    refer to this thread:
    On value request?

  • How to use search help in layout of se51

    how to use search help in layout of se51.

    Hi,
      One of the important features of screens is that they can provide users with lists of possible entries for a field. There are three techniques that you can use to create and display input help:
    Definition in the ABAP Dictionary
    In the ABAP Dictionary, you can link search helps to fields. When you create screen fields with reference to ABAP Dictionary fields, the corresponding search helps are then automatically available. If a field has no search help, the ABAP Dictionary still offers the contents of a check table, the fixed values of the underlying domain, or static calendar or clock help.
    Definition on a screen
    You can use the input checks of the screen flow logic, or link search helps from the ABAP Dictionary to individual screen fields.
    Definition in dialog modules
    You can call ABAP dialog modules in the POV event of the screen flow logic and program your own input help.
    These three techniques are listed in order of ascending priority. If you use more than one technique at the same time, the POV module calls override any definition on the screen, which, in turn, overrides the link from the ABAP Dictionary.
    However, the order of preference for these techniques should be the order listed above. You should, wherever possible, use a search help from the ABAP Dictionary, and only use dialog modules when there is really no alternative. In particular, you should consider using a search help exit to enhance a search help before writing your own dialog modules.
    Input help from ABAP dictoinary
    http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbaa5435c111d1829f0000e829fbfe/content.htm
    Field Help on the Screen
    http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbaa6135c111d1829f0000e829fbfe/content.htm
    Field Help in Dialog Modules.
    http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm
    Regards,
    Vara

Maybe you are looking for

  • Installing Wii gaming system and DVD player

    How do I install my Wii gaming system and DVD player?  I have an old floor model tv. Prior to Fios, I used a RF audio/video modulator. I still have old movies that my kids want to watch.  Thanks!  I'm not purchasing a new tv when the old one still wo

  • Fusion MiddleWare - Begineer

    Hello , I am new to FMW (Fusion MiddleWare ). I have below questions about FMW. What is the business use of FMW ? How can we use the FWM intergrate mutiple application with our ERP ? What are the other features of FMW apart from the above one ? Use o

  • Need printer driver for Canon imageclass D320

    Anyone direct me to a printer Driver for the Canon Imageless 320? Canon support says none available. Macbook pro under Yosemite. thanks

  • Restored iPod, trying to Sync music

    I finally updated my iPod. Everything was deleted off of it, but I had all my files back up so everything is saved in my iTunes. I am wondering how to get my music back onto my iPod. Every time I go to sync my music it brings up a message saying I ha

  • Urgent!!!!!!!!!!Calling a servlet setting cookie

    Hi,      The following is the complete picture of my problem. I am having a simple java servlet program in my domino server. (regarding the set-up's for executing the servlet program in the domino server....all are through...no problem over there...e