Tag Info

New answers tagged

1

Since you mentioned that are using jQuery.ajax, you could print the error details using error handler as demonstrated below: $.ajax({ url: siteurl + "/_api/web/lists/getbytitle('" + listName + "')/items", method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success: function (data) { //... ...


0

go to the IIS logs and see if more information is given about the 500 error code. I have see this error when I want to work with REST and I see IIS log and know that Actually there was problem in behaviour configuration at sevice side and then the way params I was passing at client end has problem. So I hope this usefull!


1

Since $expand operator specifies which projected fields from a joined list are returned, the REST query: /_api/web/lists/GetByTitle('<List Title>')/items(<Item Id>)/?$expand=ContentType returns list item entity with content type entity. In order to return the specific item properties along with Content Type properties, you should use ...


0

" As Franci said, OData is based on Atom Pub. However, they have layered some functionality on top and unfortunately have ignored some of the REST constraints in the process. The querying capability of an OData service requires you to construct URIs based on information that is not available, or linked to in the response. It is what REST people call ...


0

I have added this into the xml AllowAppOnlyPolicy="true" and now the code shows me a different error, already asked a question about that error here: Remote server returned an error: (500) Internal Server Error when using REST Search API


0

Because it is a user profile property you also have to set security via user profile service so it is available to everyone. EDIT: From Central Administration --> Manage Service Applications Find your User Profile Service Application and open it Under People --> click manage properties Edit your property and make sure policy setting is set for everyone. ...


1

Probably you right, I guess custom WCF service (endpoint:http://sp/_vti_bin/Namespace/Service.svc/) is used to cover specific cases that does not seem possible to perform using standard SharePoint 2013 REST API or due to performance limitations. But still, SharePoint 2013 REST API (_apiendpoint) should be considered as a preferred choice for a list items ...


0

_vti_bin was used in SP 2010 and can be used in SP 2013 as well whereas _api/web is preferred in SP 2013 and is not available in SP 2010


1

Use the $filter query option with Author property to filter items by Modified field: $filter=AuthorId eq <UserId> How to retrieve current user via SharePoint REST API If the current user is not determined, then it could be requested using the following method: function getCurrentUser(url,complete, failure) { $.ajax({ url: url + ...


3

In order to set Url Field value in SharePoint REST specify the following JSON object: URL: {Url: 'http://www.microsoft.com',Description: 'MSFT'} where URL is the name of a field. Example var metadata = { Title: 'myTitle', URL: {Url: 'http://www.microsoft.com',Description: 'MSFT'}};


0

Using SP.File.copyTo Method in REST endpoint, it is supported to copy files within a site only, for example: executor.executeAsync({ url: "<app web url>/_api/SP.AppContextSite(@target)/web /getfilebyserverrelativeurl('/Shared Documents/filename.docx') /copyto(strnewurl='/foldername/filename.docx',boverwrite=false) ?@target='<host web ...


2

REST (with jQuery.ajax): $.ajax({ url: "/_api/lists/getByTitle('Test')/getItemById(1)/AttachmentFiles/getByFileName('test.txt')", method: 'DELETE', headers: { 'X-RequestDigest': $('#__REQUESTDIGEST').val() } }); You can see the REST API endpoints at http://msdn.microsoft.com/en-us/library/office/jj860569(v=office.15).aspx . And you can see ...


0

try this: http://www.spdoctor.net/Pages/message.aspx?name=internet-explorer-cannot-display-this-feed should change the settings to display what you want (edit) scratch that thought, I just re-read your post, and I dont think this is what you asked


1

I am afraid you are out of luck. there is no api to check if user belongs to a group in AD in sharepoint. But sharepoint does have a notion of Audiences Sadly, i dont think there is no REST api for audiences either. Via code here. From here The behavior is by design. SharePoint will not unwind AD groups for audience feature to work as this will cause ...


0

You need to write the ID to the field name as shown below. Example: Field name = EmployeeName You must write the user ID to EmployeeNameId


1

The issue is that your POSTing another attachment before SharePoint is done processing the item with larger files. So when you try to perform another operation on the item (adding another attachment, etc) a race condition is is reached and SharePoint throws the error. When the attachment files are smaller, the process has time to complete before you start ...


1

Found it! /sites/ecengprodsoft/mt/_vti_bin/listdata.svc/TeamCalendar?$expand=Attendees


1

You can disable the Access permission to remote interfaces to the anonymous users, follow this: Navigate to the site (or sub-site) where you wish to enable anonymous access. Go to Settings - Site settings. Under Users and Permissions, click on Site Permissions. Under the Permissions tab, click on Anonymous Access. Choose whether you want ...


3

Instead of a network credential, you will need a SharePoint Online Credential: http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.sharepointonlinecredentials_members(v=office.15).aspx


1

You could also filter fields by SPField.CanBeDeleted property in order to get the list of questions from a Survey List How to get the list of questions from a Survey List via REST API /_api/Web/Lists/getByTitle('Survey')/fields?$filter=(CanBeDeleted eq true)


0

I found out a method. This might not be the optimised one. We can use Odata filter to get only the questions of a survey. _api/Web/Lists(guid'cecxc8b4-bbvc-472c-ae3f-d648bd0bb025')/Fields?$filter=(Hidden eq false) and (ReadOnlyField eq false) and (FromBaseType eq false)


6

Microsoft announced a preview version of an SDK for Andriod at this year's SharePoint conference. https://github.com/OfficeDev/Office-365-SDK-for-Android You could also check out this session which shows how to authenticate with SharePoint from a non-Microsoft platform. http://channel9.msdn.com/Events/SharePoint-Conference/2012/SPC118


1

Why don't you write a middle-ware service that uses Client Object Model to connect to SharePoint, I guess it will be more flexible.. Make calls to this middle-ware service from Android application.. You can authenticate using a particular user like: using (var clientContext = new ClientContext("http://siteUrl")) { clientContext.Credentials = new ...


1

Since you are using Managed code to access SharePoint Online via REST API, i would recommend you to utilize the SharePoint Server 2013 Client Components SDK. It comes with a SharePointOnlineCredentials class that is intended for authenticating the user in SPO. How to make a web request to SPO var username = "username@tenant.onmicrosoft.com"; var ...


0

Name property value (claim format) should be encoded, for example using encodeURIComponent function or as an alternative you could specify UserName property instead: /_api/Web/SiteUserInfoList/items?$filter=UserName eq 'username@tenant.onmicrosoft.com'


0

You need to change the # in the username to %23. http://spsite/_api/Web/SiteUserInfoList/items/?$filter=Name eq 'i:0%23.w|bs\user'


1

What I have working is the following: Method POST URL http://www.somewhere.com/testsite/_api/web/GetFolderByServerRelativeUrl('/testsite/Shared Documents')/Files/add(url='filename.png',overwrite=true) Header Content-Type: application/octet-stream Accept: application/json;odata=verbose X-RequestDigest: ... Body Raw binary bytes (no JSON) Then in ...


6

Very interesting question and good answers. I have tested it on a usual Tasks list and got it working after trial and error. The link provided above, Using CAML in REST requests, is good, although it contains syntax errors and unintroduced variables that makes it harder to try out the examples. Robert Kaucher has a working solution, even though it contained ...


4

Try the following. Notice that you need to use POST as you are sending data. You also need the <View>and <Query>tags. <View> <Query> <Where> <Or> <Eq> <FieldRef ID="Assigned To" /> <Value Type="Integer"><UserID/></Value> ...


3

The GetItems method in the REST api accepts a CAML query. Have you tried that? http://msdn.microsoft.com/en-us/library/office/dn531433%28v=office.15%29.aspx#bk_ListGetItems


0

After referring this Link I have clear the Idea what is actual problem And I got the solution. For taking the date with my current Timezone just few changes required to get correct date, It's: $("#isJson").text(new Date($( "#effectiveDate" ).val()).toDateString()); This gives you correct answer


1

I don't have high enough reputation to comment, but I already gave the answer to this over here: Folder creation in Document library using listdata.svc On creating folders in lists, its the same way, but without the "slug" header and you just add "/Lists" to beginning of the "Path" property.


0

Instead of giving Full Control permissions on Web give Full Control permissions on the library only.


0

Here's how I fixed it in my case. Uninstall the app, then in the Office 365 Admin Center, click apps then App Permissions. Delete any app permissions left behind for your app, and install the app again. I think what was happening was that it was using the wrong set of permissions and sending the app an invalid token.



Top 50 recent answers are included