Tag Info

Hot answers tagged

2

If I got you right, you search for documents using CSOM/REST. Let's assume you try to use 'query' method of '_api/Search' endpoint. All you need is to define selectproperties for query: You may need SPWebUrl to construct request to REST endpoint for item properties. Let me assume you're using on-premises SharePoint Server 2013 installation. In this case ...


2

To get the default values of columns you first need to get the columns and then use the get_defaultValue() method to get the default value. this.list = webSite.get_lists().getByTitle("ListTitle"); this.fieldCollection = list.get_fields(); this.field = fieldCollection.getByTitle("FieldTitle"); Once you get the field you can use the below code to find the ...


2

Although I couldn't find a way to retrieve the custom user profiles by using the user profiles REST api since the properties are returned in an array and AFAIK no existing method exists to filter them from the URL but since some of the OOB user profile properties are stored to the user information list, you can maybe try this: var userId = ...


2

As mentioned here in MSDN, There are two functions in SP to get the properties getUserProfilePropertiesFor // for multiple properties, not availablee in REST GetUserProfilePropertyFor // for single property MSDN documentation has clearly stated that the "getUserProfilePropertiesFor" method is not implemented in REST (search for ...


1

You need three additional headers: "X-RequestDigest":"value" A unique security token to validate your requests. "X-HTTP-Method": "MERGE" To indicate that you're performing an update "If-Match":* To handle concurrent requests. This actually has 2 values viz. item.__metadata.etag representing the actual item tag and * to handle any value. As an example ...


1

Try http://site/_api/web/currentuser. This should return the current logged in user that is used to send the REST query.


1

If you want to get only the specific property value then use "getuserprofilepropertyfor" & pass the current user login name $.ajax({ url: "http://<site url>/_api/sp.userprofiles.peoplemanager /getuserprofilepropertyfor(accountName=@v, propertyname='Office') ?@v='i%3A0%23.f%7Cmembership%7Csekhar%mydomain.onmicrosoft.com'", ...


1

Question resolved. The error message is completely misleading. It has nothing to do with the token - the problem lies within the strict POST message format SharePoint is requiring. If you use the following headers for your POST request, everything works fine. headers = {'X-RequestDigest': token, 'Accept': 'application/json; odata=verbose', ...


1

Add a new result source at your site collection level, configure search query in that result source to retrieve items related to "Task" content type. Copy the result source id. use REST search api to get the items from that result source, Or just create a search result webpart with result source. and implement display templates to customize the look and ...


1

You're not using... REST: https://msdn.microsoft.com/en-us/library/office/ff521587%28v=office.14%29.aspx You're using... RPC Protocol: https://msdn.microsoft.com/en-us/library/office/ms478653%28v=office.14%29.aspx As such, you need to add &CacheControl=1 to your URL, to keep the data from being cached from the last call...


1

I know this question is old but it might help someone doing Research on this. I recently wrote a script to figure out access rights and found something that might help. Here is a simplified Version from the object model to illustrate what i mean: Web -----> RoleAssignments -----> Member -------> ...


1

b1c10's answer is probably on the right track, stating that the problem might be on the file input, try to check if you actually upload the correct stream to the REST API. If the stream is already corrupted before the actual upload, it has nothing to do with your POST. Try to convert your stream back to the original file locally and see what that tells you. ...



Only top voted, non community-wiki answers of a minimum length are eligible