Hot answers tagged

5

Appweb and Hostweb are two different origins, so something has to allow your AppWeb to access the Hostweb. If your code would work any script could access your site. Search for HostWeb AppWeb access on Google. Your IE most likely works because it was already authenticated on the Site.. try it with InPrivate browsing. PS: odata=verbose gives you a lot of ...


3

I was having the same query which you have. But unfortunately i found that REST Service does not supports GROUP BY functionality as per this REST Service But not to worry, you can still achieve this just you need to do some extra stuffs. The methodology which i used was Get all data from REST Service. Created a function which do required GROUP BY ...


2

what REST call were you using? You should have been able to get a whole bunch of items using OData filtering. Something like this: var itemtitle = "Some Title" $.ajax({ url: _spPageContextInfo.webServerRelativeUrl + ...


2

You need to allow CORS to be able to do this. The problem is that javascript doesn't allow cross domain calls, and the Azure service can't have the same domain name as your Office 365 (At least I'm pretty sure of this). By enabling CORS support in your Azure REST API, you can circumvent this. Do be warned however, that CORS must be supported by the browser ...


2

Yes it is possible to create *.docx file in document library using REST services. For more detail you can refer this MSDN article Files and folders REST API reference Let me know whether this helped you. Thanks


2

Using below mentioned functions you can upload document to Document library. Here you need to change the below mentioned code according to your needs like here it is mentioned document library name as "Project Documents" so please change it with your library name. You have to make three calls. The first uploads the file, the second retrieves the list item ...


2

If you want to perform CRUD operation on SharePoint Online lists, for that you can use C# code with console app or window app or else create web application. The same requirement i was also having. So i used C# console application. And yes you need to authenticate first, and for authentication you can use Username and Password into the code itself which ...


2

You can set your logo managed property any way you like. In my case I have a special site catalog content type that stores my site info (way easier than using the property bag). What I think you are missing is that the site "preview" is a live view of the site home page in an iFrame. In my case I modified the out of the box Item_Picture display template and ...


2

I only browsed your code You have to look closely at WHERE inside the then resolves your code runs, ie. if (errCnt>0) will run before attachments are found. Also try to merge your code, you have 2 branches that almost do the similar, merge them into one... your code will become smaller.. your code will be easier to debug


2

(I must say it is embarrassing to admit this) I have (partially) done this with REST. I had used Newtonsoft.Json to parse the responses and HttpWebRequests to interact with the REST API. (I think you would be able to work with Atom using System.Xml as well.) However I am not aware of a single library doing the process end-to-end.


2

I have to say, I'm not a big fan of the do this for me questions, but this is a a good start to converting your JSOM to REST/AJAX. I haven't tested this, but this should be a good starting point for you. var qString = window.location.href.split("?ID=")[1]; var listName = "My list"; var collListItem; $.ajax({ url: ...


1

Use the AND operator to join the filters https://mydomain.sharepoint.com/mysite/_api/web/lists/GetByTitle('MyList')/items?$filter=Column1 eq 1 AND Column2 eq 2 AND Column3 eq 3


1

Before your foreach loop, assign a new dynamicValue to the d/results property of the GatePassDetailsProperties dynamicValue (or reuse and reassign the current dynamicValue). Then, for each item, you'll be able to get Title, Nationality, JobTitle, PassportNo as the top-level property. Also, make sure your assignments are going to variables and not the ...


1

It is already mentioned in your REST query. You just need to change the value from 2917 to 1000. Make sure to place that as first parameter like below. https://xxxxxxxxxx/_vti_bin/ListData.svc/MapData?$top=1000&$select=State_abb,County,Indemnity,County_code&$orderby=State asc,County asc It will get only top 1000 records from list.


1

Here you can use any of the query but before that you must be clear with your own requirement. If you want to get data with specific parameter (like you want to filter your data) then you can use the following code Here i am just updating your code to pass the fieldname and fieldvalue. ( here i am assuming your list contain only one record, in case of ...


1

Item can be created by calling REST service API from SharePoint workflow.SharePoint workflow provide various actions like call,Build etc. Build action is used to call your REST service API. Call action calls the REST service and execute the action that you have given into REST API. Please look at this Rest call using SharePoint workflow for reference ...


1

Try below approach. It worked fine for me. var siteUrl = "http://mysite"; $.ajax({ url: siteUrl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties", method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success: function (data) { for (var i = 0; i < ...


1

Found the solution... Check out the steps below: First retrieve the JSON (shown above) to a DynamicValue (i.e. ResponseDV) through an HttpSend activity. Use an GetDynamicValueProperties activity and use the above DynamicValue as source and the properties setup will like shown below. ParsedDynamicValue is a new DynamicValue, and the setting the Path is ...


1

You first need to make a POST request to http://<DomainName>/home/_api/contextinfo to get a request digest. Then you'll have to add that as a header X-RequestDigest to your actual POST to add the list item. The token is valid for 30 minutes, I believe, so you may want to cache it if you are expecting this procedure to be accessed multiple times within ...


1

You do not need to pass the credentials. Please look into below mentioned code to get single item from list using REST API. function getListItem(url, listname, id, complete, failure) { // Getting our list items $.ajax({ url: url + "/_api/web/lists/getbytitle('" + listname + "')/items(" + id + ")", method: "GET", headers: { ...


1

If you are developing a mobile app which will communicate with your SharePoint 2013 then you can use the common services that can be accessed using open protocols. If your REST Service API codes are hosted in your SharePoint environment then in that case you do not need any authentication mechanism. But if your code is hosted somewhere else other than ...


1

Based on what Danny said to me, I looked a bit further into the context of which the REST calls are made. Using this as my resource my working code looks like so: var SPHostUrl = decodeURIComponent(getQueryStringParameter("SPHostUrl")); var SPAppWebUrl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl")); //Subsites ...



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