Sharepoint 2013 REST API calls with JASONP support
We are working on sharepoint online integration with PHP Based application. We need to provide REST API call which supports JSONP.
So is it possible to create new REST API Endpoints in Sharepoint online APP? Please sugggest right direction.
Hi,
In Office 365 (aka SharePoint Online), you can simply consume the SharePoint data through REST API or WS call,but cannot create your own endpoint.
By default you can get the JSON response from the Office 365 REST API,its upto you to use the JSONP on your client compatibility not on SharePoint online REST API.
Sometime before I tried, It didn't work for me.
If you develop the AppModel, SPRequestor.js does the same job(overcome the Cross domain restriction) the what JSONP does.
Murugesa Pandian| MCPD | MCTS |SharePoint 2010
Similar Messages
-
SharePoint 2013 REST API with C# - Mapping HTTP verbs to data operations - Requesting FormDigest
SharePoint REST interface maps HTTP verbs to data operations. Endpoints that represent
Read operations map to HTTP
GET commands. Endpoints that represent update operations map to HTTP
POST commands, and endpoints that represent update or insert operations map to HTTP
PUT commands (Ref:
How to: Complete basic operations using SharePoint 2013 REST endpoints).
Is this mapping of HTTP verbs to CRUD operations a design paradigm or whether there are other technical reasons to this mapping
Is is possible to use a GET command for say an update operation or a POST for say a read operation.If so, what consideration make the choice of either usage
In the code snippet below FormDigest is requested as POST, why not use GET here?
private static string GetFormDigest(string webUrl)
//Validate input
if (String.IsNullOrEmpty(webUrl) || String.IsNullOrWhiteSpace(webUrl))
return String.Empty;
//Create REST Request
Uri uri = new Uri(webUrl + "/_api/contextinfo");
HttpWebRequest restRequest = (HttpWebRequest)WebRequest.Create(uri);
restRequest.Credentials = CredentialCache.DefaultCredentials;
restRequest.Method = "POST";
restRequest.ContentLength = 0;
//Retrieve Response
HttpWebResponse restResponse = (HttpWebResponse)restRequest.GetResponse();
XDocument atomDoc = XDocument.Load(restResponse.GetResponseStream());
XNamespace d = "http://schemas.microsoft.com/ado/2007/08/dataservices";
//Extract Form Digest
return atomDoc.Descendants(d + "FormDigestValue").First().Value;
Thanks - AbhishekMany SharePoint REST api methods use parameters. It is much more efficient to post parameters than use query string variables. Many times complex types are sent and these require json notation objects posted in the body. In the case of "_api/contextinfo,
it is recommended to use POST rather than a GET when using sensitive data. GET responses can be cached. Since you are getting a security token back in that call it is recommended to use a POST.
http://blog.teamtreehouse.com/the-definitive-guide-to-get-vs-post
Blog | SharePoint Field Notes Dev Tools |
SPFastDeploy | SPRemoteAPIExplorer -
I am trying to invoke the SharePoint Rest Api using HTML page. I have included the Access Control Allow Origin to the web.config file. I am getting Readty State 4 and
Status Success but still I am getting the below error.
Refused to execute script from 'http://<server>/_api//web/lists?callback=jQuery172045857910416089_1430217181282&_=1430217363882' because its MIME
type ('application/atom+xml') is not executable, and strict MIME type checking is enabled.
<script>
$(document).ready(function () {
$("#KMPDiscussions").click(function () {
//$.support.cors = true;
$.ajax({
url: "http://<server>/_api//web/lists",
dataType: "jsonp",
type: "GET",
method: "GET",
contentType: "application/javascript",
headers: {
"content-type":
"application/json;odata=verbose",
"accept": "application/json;odata=verbose",
success: function onSuccess(data) {
alert("Inside Alert");
error: function onError(data){
alert("Error: "
+ data);
</script>
It always hits the error on callback.
Is there any other way that I can invoke SharePoint Rest Api from a Cross Domain. Please Help.Hi Chris,
Thanks for the reply,Here iam using different files to be uploaded in library.
please find the below snapshot of json response and ULS logs.
12/22/2013 18:31:15.02 w3wp.exe (0x3338) 0x401C SharePoint Foundation Files
abq2i High Could not get DocumentContent row: 0x80004005. 79f7629c-4694-c026-
3349-2049178ee919
12/22/2013 18:31:15.02 w3wp.exe (0x3338) 0x401C SharePoint Foundation Files
aiv4w Medium Spent 0 ms to bind -1 byte file stream 79f7629c-4694-c026-3349-
2049178ee919
12/22/2013 18:31:15.02 w3wp.exe (0x3338) 0x401C SharePoint Foundation Files
aise3 Medium Failure when fetching document. 0x80070012 79f7629c-4694-c026-
3349-2049178ee919
12/22/2013 18:31:15.39 w3wp.exe (0x3338) 0x0D4C SharePoint Foundation
Database ab1a9 High Failed to get document content data.
System.ComponentModel.Win32Exception (0x80004005): Cannot complete this function at
Microsoft.SharePoint.SPSqlClient.GetDocumentContentRow(Int32 rowOrd, Object
ospFileStmMgr, SPDocumentBindRequest& dbreq, SPDocumentBindResults& dbres)
79f7629c-76ab-c026-3349-2c9132b13e9a
12/22/2013 18:31:15.39 w3wp.exe (0x3338) 0x4184 SharePoint Foundation
Database ab1a9 High Failed to get document content data.
System.ComponentModel.Win32Exception (0x80004005): Cannot complete this function at
Microsoft.SharePoint.SPSqlClient.GetDocumentContentRow(Int32 rowOrd, Object
ospFileStmMgr, SPDocumentBindRequest& dbreq, SPDocumentBindResults& dbres)
79f7629c-76ab-c026-3349-281167b6cd09
Thanks again,
Naresh. -
SharePoint 2013 Rest API - How to get the item count with startsWith
Hi All,
I am using the below url to get the item count for specfied startsWith. For example I want to know how many items are there in the list which starts with "A". When i hit the below url in the address bar i am getting HTTP not found.
siteURL/sites/Apps/SharePointApp3/_vti_bin/listdata.svc/SampleList/items?$filter=startsWith(Title,’A’)
Navaneethwhat
is SharePointApp3.
here.
it is a webpart.
this will not work on webpart\apps
Also I am not sure if it will work with specific SampleList
Try
siteURL/sites/Apps/SharePointApp3/SampleList/_vti_bin/listdata.svc/Keywords?$filter=substringof('r',Title)
If this helped you resolve your issue, please mark it Answered -
SharePoint 2013 Rest Api - How to get List Items
Can anyone let me know why the below method fails? I am not getting where i am making mistake. Please help
function getListItems(term) {
var caml = "<View><Query><Where><BeginsWith><FieldRef Name=Title/><Value Type='Text'>" + term + "</Value></BeginsWith></Where></Query></View>";
var requestData = { "query": { "__metadata": { "type": "SP.CamlQuery" }, "ViewXml": caml } };
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/getbytitle('SampleList')/Getitems",
method: "POST",
data:requestData,
headers: {
"accept": "application/json; odata=verbose",
"content-type": "application/json; odata=verbose"
success: function (data) {
$("#countItem").html("Pass");
error: function (data) {
$("#countItem").html("Fail");
Below is the responseText (log)
"{\"error\":{\"code\":\"-1, Microsoft.SharePoint.Client.ClientServiceException\",\"message\":{\"lang\":\"en-US\",\"value\":\"The HTTP method \'GET\' cannot be used to access
the resource \'GetItems\'. The operation type of the resource is specified as \'Default\'. Please use correct HTTP method to invoke the resource.\"}}}"
NavaneethFinally executed successfully using below code. The learning is we need to use type:"POST" instead of method:"POST"
function getListItems(term) {
var urltest = _spPageContextInfo.webAbsoluteUrl + "/_api/Web/lists/getByTitle('SampleList')/getitems(<Query><Where><BeginsWith><FieldRef">query=@v1)?@v1={\"ViewXml\":\"<View><Query><Where><BeginsWith><FieldRef
Name='Title'/><Value Type='Text'>" + term + "</Value></BeginsWith></Where></Query><RowLimit>1</RowLimit></View>\"}";
$.ajax({
url: urltest,
type: "POST",
headers: {
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"Accept": "application/json; odata=verbose",
"Content-Type": "application/json; odata=verbose"
contentType: 'application/json',
success: function (data) {
if (data.d.results.length != 1) {
$("#countItem").html("Pass");
$("#" + term).parent().parent().prop('disabled', true);
$("#" + term).removeAttr("onclick");
$("#" + term).css('cursor', 'default');
$("#" + term).parent().unbind("mouseenter mouseleave");
error: function (data) {
$("#countItem").html(urltest);
Navaneeth -
HTTP REST API call to CPSC 10.x from an external system
Hi,
I would like to know the below items.
Is it possible to connect with the CPSC 10.x from an external system via HTTP REST API call to process a request and complete a task?
Is it possible to create a new ticket / request in CPSC for a specific service via the HTTP REST API call?
One of the use case is to know how many requests are pending in a queue via a HTTP REST API call? How to pass a queue name in the HTTP REST API call to get the result? These kind of custom piece is not available in the integration guide.
Is there any specific REST API guide available which Cisco provides for the REST capability in CPSC?
Any help is highly appreciated!
Thanks.When a task is invoked from a service catalog request to an external system, the request remains open and the task is pending until the external system issues a call to complete the task. The API for completing the task is SOAP-based. Check out the Cisco Prime Service Catalog Integration Guide. Within the doc, go to the section about "Web Service Listener Adapter" for the WSDL.
You can order a service within Prime Service Catalog with a SOAP call, which is also documented in this same document. Starting with Prime Service Catalog 10.1, you will have a way to order a service via a REST API.
Existing REST APIs are also documented in the integration guide. -
Im using CloverETL to connec to SharePoint using REST API.
my team is trying to get the List items in SharePoint using REST api. we are using the CloverETL tool using the REST api URL of the list and the credentials in SharePoint which has full control. Below is the rest command that we used.
/_api/web/lists/getbytitle('title of list')/items
when viewing this URL on the same Internet explorer with a user log on to sharepoint the XML of the list is successfully showing. but when we try to load it on the CloverETL tool using the same SharePoint credentials it says access is denied. Also when viewing
the URL to a browser with no other SharePoint sites open it also says access is denied.how is the webapp configured, as far as authentication?
Scott Brickey
MCTS, MCPD, MCITP
www.sbrickey.com
Strategic Data Systems - for all your SharePoint needs -
Hi,
We are planning monitoring our cluster using SCOM 2102R2 server. REST API developed for our cluster. How to call these REST API calls in SCOM 2012R2 server? I searched, I am not able to find. Please help me with any steps or documents or with links. I am
struct here. I am new to SCOM 2012 server.
Thanks,
BoopalanYou can refer below links
http://mountainss.wordpress.com/2014/05/02/windows-azure-pack-service-management-api-samples-april-2014-wapack-scvmm-ws2012r2/
http://www.vmunify.com/tag/windows-server-2012-r2/
Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
Mai Ali | My blog: Technical | Twitter:
Mai Ali -
Adding Custom Breadcrumb for SharePoint 2013 Custom Master-Page With A Custom Separator.
Hi All,
I have successfully converted an HTML file to a SharePoint 2013 Custom Master-Page with relevant style sheets. But when I used within the SharePoint site I could not find the breadcrumb. So I want to know how to do that? For that breadcrumb I need a custom
separator like an arrow like in the below.
As you can see the separator is a custom built one. To have this custom separator in my HTML I have used the following code snippet.
<div class="breadcrumb-desktop">
<span class="breadcrumb-links"><a href="#">SharePoint Site Home</a></span>
<span class="breadcrumb-links"><a href="#">Sub Link 01</a></span> Active Page
</div>
The styles are as like in the below.
.breadcrumb-desktop {
width: 100%;
font-family: Arial;
padding: 23px 0 40px;
float: left;
font-size: 0.75em;
line-height: 1.25;
.breadcrumb-desktop > span.breadcrumb-links:after {
content: " \203A ";
white-space: pre;
I have tried the following code snippet within the SharePoint site as
<!--MS:<asp:sitemappath runat="server" sitemapproviders="SPSiteMapProvider,SPXmlContentMapProvider" rendercurrentnodeaslink="false" hideinteriorrootnodes="true">-->
<!--ME:</asp:sitemappath>-->
But it did not display as I wanted.
So how am I supposed to insert these to my Custom Master-Page's breadcrumb and style them? Please could someone help me to solve this?
Thanks and regards,
ChiranthakaHi Chiranthaka,
Please use the following code snippet in your html master page.
<div class="CustomBreadcrumbs">
You are here:
<!--SPM:<SharePoint:AjaxDelta id="DeltaPlaceHolderPageTitleInTitleArea" runat="server">-->
<!--SPM:<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">-->
<!--MS:<asp:sitemappath runat="server" sitemapproviders="SPSiteMapProvider,SPXmlContentMapProvider" rendercurrentnodeaslink="false" hideinteriorrootnodes="true">-->
<!--ME:</asp:sitemappath>-->
<!--SPM:</asp:ContentPlaceHolder>-->
<!--SPM:</SharePoint:AjaxDelta>-->
</div>
Here is a thread for your reference:
https://social.msdn.microsoft.com/Forums/office/en-US/daabd903-df98-41da-80d8-6a942d06980e/add-breadcrumb-to-custom-master-page-html-file?forum=sharepointcustomization
We can also customize a breadcrumb control, then add it in master page.
http://msreddysharepoint.blogspot.com/2013/01/custom-breadcrumb-navigation-in.html
Best Regards
Dennis Guo
TechNet Community Support -
Hello everyone,
Within a list form, user has to select a value amongst a huge number of availables options.
Instead of using something like a dropdown list, which would be very boring to parse, I would like to display possibles values in a treeview.
To do that, I tried to use an <Sharepoint:SPTreeView bind to a SharePoint:SPXmlDataSource who read data from an XML File.
<SharePoint:SPXmlDataSource runat="server" DataFile="../../SiteAssets/App_Data/myfile.xml" AutoSave="True" XPath="" ID="myDataXml"></SharePoint:SPXmlDataSource>
<SharePoint:SPTreeView runat="server" ID="MyTreeView" DataSourceID="myDataXml" />
But when I try to display the form in my web browser, an error occurs.
Therefore, my question is : Is it possible to display the content of an Xml file as a treeView in a SharePoint 2013 custom form edited with SharePoint Designer 2013 ?
If the answer is yes, how ? Which are the required properties for "SharePoint:SPXmlDataSource" tag and "SharePoint:SPTreeView" tag ?
What are the requirements to use thoses tags ?
Regards,
Florian.
Ps : I dont have access to the server side of the SharePoint site I am working on.Assuming that https://fullsitename is a new URL address did you make sure to update your browser to include it in the Trusted Sites zone? The message you are quoting is exactly the one you get if you don't have it in Trusted Sites.
Paul Stork SharePoint Server MVP
Principal Architect: Blue Chip Consulting Group
Blog: http://dontpapanic.com/blog
Twitter: Follow @pstork
Please remember to mark your question as "answered" if this solves your problem. -
HTTP Rest api call maximum results
Hi all,
I´m trying to get data from the portal using the follwoing rest api call:
http://<ServerURL>/RequestCenter/nsapi/serviceitems/serviceitemsubscription
but it only gives me 20 results, which I believe it is the default, is there any way to get all the elements or a way to page all the results?
Thanks
Alex.Hi all,
found some info on the Integration guide (Cisco Prime Service Catalog 10.0 Integration Guide) page 222, there is a section regarding Paging, but the max results are 50.
I was looking a simple way to export / import info from the portal, but it seems Java is going to be neded instead http nsapi.
Regards,
Alex. -
Sharepoint 2013 webDAV PROPPATCH fails with status code 409 error every time, when trying to set custom property.
anyone have any ideaHi
Stumbled upon the resolution myself. The Bean Area item needs to be set to Visible=Yes in the property palette for the bean within Forms Builder, and also the implementation class also in the bean's properties must match exactly the package & class name specified in the PJC (my full implementation class string had to be set to oracle.forms.demos.runApplication).
As this bean has no user interface component, and since the Visible property has to be set to Yes, to avoid having a random square shape for the bean sitting on the form's canvas, I also set the Width and Height properties for the bean to 0.001. This does show a very small dot on the form, but that will be acceptable.
So in summary there has been a change for PJC / Bean Areas between 6i and 10g Forms, in 6i you could have the Bean Item to be set Visible=No, and the SET_CUSTOM_ PROPERTY built-in would work, however in 10g Forms the Bean Item must be set to Visible=Yes for the SET_CUSTOM_PROPERTY built-in to work.
Daryl -
i am in Iraq right now and i cannot make any schedule for having a call with your support team , however, i forgot the answer for security questions , and also previously i have not summited a rescue Email address is there any way to reset my account?
Please be aware that you are not communicating with Apple when you post in these forums. These are user-to-user support forums, so in almost all cases the only people who will reply to your posts are, like me, your fellow users.
As to whether you can work with Apple via email on this issue I can't say for sure, but you can contact them via this web page:
http://www.apple.com/support/appleid/contact/
and see if they can help. It's mostly going to be an issue of you being able to prove to them that you are the account owner.
Regards. -
External Rest API call from SharePoint 2013 On Premises
Hi All,
May my questions is silly but I am totally tired by trying different things.
I need to call a third party rest api from my SharePoint Designer page using &Ajax call.First time when i tried it gave me access denied then added this line
jQuery.support.cors =true;
Again error changed to "No Transport" last time i had the same situation i saw some sites where people mentioned some power shell script to enable something at web app level but didn't remember if possible can some help me please i already wasted
my half long weekend :(
Note :- This is SharePoint On Premises
Thanks in Advance :)Hi All,
May my questions is silly but I am totally tired by trying different things.
I need to call a third party rest api from my SharePoint Designer page using &Ajax call.First time when i tried it gave me access denied then added this line
jQuery.support.cors =true;
Again error changed to "No Transport" last time i had the same situation i saw some sites where people mentioned some power shell script to enable something at web app level but didn't remember if possible can some help me please i already wasted
my half long weekend :(
Note :- This is SharePoint On Premises
Thanks in Advance :) -
Call an Non-SharePoint Secured RESTful API from a Workflow in a SharePoint Online Tenant
I have a scenario where I need to be able to make calls to a secured web service from a SharePoint 2013 workflow that will be deployed in a SharePoint Online (Office 365) environment. It is a REST web service that is secured in a 2-legged OAuth-like manner
(the service expects a hash of the data being sent that can then be validated on the service's end of the communication). The problem is, I can't figure out how I can hash the data, since I can't run any server-side code in the SharePoint Online environment.
The way I figured this should work is 1) user creates an item in a List on the SharePoint Site, which kicks off the workflow process. 2) the workflow process takes the user data and hashes it using a client secret assigned by the web service. 3) the
workflow creates a web request to the web service, passing the data and the hashed values. 4) the web service processes the input and returns. 5) the workflow continues to the next step.
I can't figure out how to implement step 2 in that process. I thought I could do a custom workflow activity that would accomplish it, but since it would pretty much have to be a code-based activity (i.e., not declarative), it can't be deployed in SharePoint
Online, according to the domentation I've found. I could potentially add a third layer in the process and have an auto-hosted app that I could call to do the hashing of the data, but that seems to defeat the purpose somewhat from a security perspective.
Has anyone else run into this kind of scenario? Doing this in an on-premesis environment would be easy, but that's not really an option.
Thanks!You should implement this by passing the values to a public (forms based auth) web method (secure over SSL) that does the hash for you and returns the value to your workflow so that it can pass it on to the other service.
Chris Givens CEO, Architecting Connected Systems
Blog Twitter
Maybe you are looking for
-
80GB Classic will no longer sync with Outlook
I have a 80GB Classic that will no longer sync my Outlook contacts or calender. It will sync everything else, music, movies, games, but than it just hangs. It will say that it is syncing and not to disconnect, but it will stay that way for hours and
-
I can't actualize US iPod with german music
I have the following problem: I have an iTunes account in Germany and bought an US iPod last week. Today i downloaded some titles from the german iTunes store (the US store guided me automatically to the german store, because the titles were not avai
-
On Mac. Colours changed after switching to 64bit mode (ver 2.7)
Been using Lightroom 2.7 on my iMac quite happily and after reading a few articles realised it wasn't running in 64bit so changed it. Now colours are all out, most noticeable on reds: Before change After Change Any ideas why this is happening? Tried
-
Need help Installing OID Repository on existing database server using RepCA
I have an oracle database server running 10g (10.2.0.4) and I want to install metadata repository on it. I downloaded the Application Server Metadata Repository Creation Assistant 10.1.2.0.1 (standard edition). I find that there are no batch files in
-
Disk Utility boot cd / dvd
If I need to run disk permissions from the install dvd, is it possible to make a boot cd/ dvd that just has disk utility or the install apps to save me scratch my original dvd ? I know I could clone the install disc but it is double layed.