REST API usign ajax

Hello
I am trying to make use of REST API using ajax, but its failing giving the error message: "NetworkError: 403 Forbidden - https://secure.eloqua.com/API/REST/1.0/data/contact/123"
Below is the javascript code I am using:
<script>
    jQuery.ajax( {
     type: 'GET',
     url : 'https://secure.eloqua.com/API/REST/1.0/data/contact/123', 
     dataType : 'json',
     async: false,
     beforeSend : function(xhr) {
          xhr.setRequestHeader("Authorization", "Basic " + <base64>);
    error : function(xhr, ajaxOptions, thrownError) {
        alert("error");
     success : function(data) {
        alert("success");
</script>
Thanks and appreciate your Help !!

Yes, I am using the correct base URL for the API. The response I get is:
"urls": {
"base": "https://secure.eloqua.com",
"apis": {
"soap": {
"standard": "https://secure.eloqua.com/API/{version}/Service.svc",
"dataTransfer": "https://secure.eloqua.com/API/
"email": "https://secure.eloqua.com/API/
/DataTransferService.svc",
     /EmailService.svc",
"externalAction": "https://secure.eloqua.com/API/
"rest": {
"standard": "https://secure.eloqua.com/API/REST/
/ExternalActionService.svc"},
"data": "https://secure.eloqua.com/API/Data/
"bulk": "https://secure.eloqua.com/API/Bulk/

Similar Messages

  • Performance issue during SharePoint list data bind to html table using Ajax call(Rest API)

    Hello,
    I am having multiple lists in my SharePoint Site. I am using SharePoint REST APIs to get data from these lists and bind a HTML Table. Suppose, I have 5 lists with 1000 records each, I am looping 5000 times to bind each row(record) to this html table. This
    is causing performance issue which is taking a very long time to bind. 
    Is there any way So that I can reduce this looping OR is there any better approach to improve the performance. Please kindly Suggest.  Thank you for your help :)
    Warm Regards,
    Ratan Kumar Racha

    Hi Racha,
    For handling large data binding in a page,
    AngularJS would be a great option if you might would worry about the performance.
    You can get more information about using AngularJS from the two links below:
    https://www.airpair.com/angularjs/posts/angularjs-performance-large-applications
    http://www.sitepoint.com/10-reasons-use-angularjs/
    Best regards
    Patrick Liang
    TechNet Community Support

  • Trying to Access SharePoint 2013 Rest Api in HTML page but getting Mime Type Exception with Status Success

    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.

  • Add user to sharepoint group using REST API

    I am trying to add a user to sharepoint group with following code
    serviceUrl= Appweb + "/_api/SP.AppContextSite(@target)/web/sitegroups("+GroupId+")/users?@target='host web'";
        $.ajax({
            url: serviceUrl,
            type: "POST",
            contentType: "application/json; charset=utf-8",
            dataType: 'json',
            body: "{'__metadata': { 'type': 'SP.User' },'LoginName':'i:0#.f|membership|'+email }",
      headers: {"accept":"application/json;odata=verbose",
        "content-type": "application/json;odata=verbose",
        "X-RequestDigest":$("#__REQUESTDIGEST").val()
        async: false,
      success: function (data) {
               alert('success');
      error: function (data) {
                 alert('fail');
    The request goes to error function. Response of the request is Microsoft.SharePoint.Client.InvalidClientQueryException and message is A node of type 'EndOfInput' was read from the JSON reader when trying to read the start of an entry. A 'StartObject' node was
    expected
    I tried the sample from following link but fail it
    https://msdn.microsoft.com/en-us/library/office/dn531432.aspx

    Hi,
    Per my understanding, you might want to add an user to a SharePoint group in host web from a SharePoint Hosted App using REST API.
    Here is a working demo for your reference:
    var hostweburl;
    var appweburl;
    $(document).ready(function () {
    //Get the URI decoded URLs.
    hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
    appweburl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));
    // Resources are in URLs in the form:
    // web_url/_layouts/15/resource
    var scriptbase = hostweburl + "/_layouts/15/";
    // SP.RequestExecutor.js to make cross-domain requests
    $.getScript(scriptbase + "SP.RequestExecutor.js", loadPage);
    // Utilities
    // Retrieve a query string value.
    // For production purposes you may want to use a library to handle the query string.
    function getQueryStringParameter(paramToRetrieve)
    var params = document.URL.split("?")[1].split("&");
    for (var i = 0; i < params.length; i = i + 1)
    var singleParam = params[i].split("=");
    if (singleParam[0] == paramToRetrieve) return singleParam[1];
    function addUsersInGroup() {
    var executor;
    // Initialize the RequestExecutor with the app web URL.
    executor = new SP.RequestExecutor(appweburl);
    executor.executeAsync({
    url: appweburl + "/_api/SP.AppContextSite(@target)/web/sitegroups(8)/users?@target='" + hostweburl + "'",
    method: "POST",
    contentType: "application/json; charset=utf-8",
    dataType: 'json',
    body: "{'__metadata': { 'type': 'SP.User' },'LoginName':'i:0#.f|membership|[email protected]'}",
    headers: {
    "Accept": "application/json; odata=verbose",
    "content-type": "application/json;odata=verbose",
    "X-RequestDigest":$("#__REQUESTDIGEST").val()
    success: addUsersInGroupSuccessHandler,
    error: addUsersInGroupErrorHandler
    function addUsersInGroupSuccessHandler(data)
    console.log(data);
    var jsonObject = JSON.parse(data.body);
    console.log(jsonObject);
    function addUsersInGroupErrorHandler(data)
    console.log(data);
    var jsonObject = JSON.parse(data.body);
    console.log(jsonObject);
    Thanks 
    Patrick Liang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected].

  • Sharepoint-Hosted App giving FORBIDDEN error when i use REST Api

    Hi,
    I have created a sharepoint hosted app which will create Team site on button click.
    I used REST Api  and  NAPA Tool to develop this app.
    Napa tool gives to things ClientWebpart.aspx and Default.aspx.
    When i run my Default.aspx code is working fine but ClientWebpart.aspx is giving FORBIDDEN error when i am trying to create site.
    Below is the code which i used to create site
    code:
    var hostweburl;
    var appweburl;
    $(document).ready(function () {
    hostweburl= decodeURIComponent(getQueryStringParameter("SPHostUrl"));
    appweburl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));
    function createSPWeb() {
    $.ajax(
    url: appweburl +
    "/_api/SP.AppContextSite(@target)/web/webinfos/add?@target='" +
    hostweburl + "'",
    type: "POST",
    data: JSON.stringify(
    'parameters':
    '__metadata': { 'type': 'SP.WebInfoCreationInformation' },
    'Url': 'RestSubWeb',
    'Title': 'RestSubWeb',
    'Description': 'REST created web',
    'Language': 1033,
    'WebTemplate': 'sts#0',
    'UseUniquePermissions': false
    headers: {
    "accept": "application/json;odata=verbose",
    "content-type": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val()
    success: successHandler,
    error: errorHandler
    NOTE:This is on sharepoint online.
    Please help
    Regards,
    sudeep

    So in the app you are testing, are you using the FQDN or the NetBIOS name? Bad practice but could you test with both (hard code the absolute URL for testing purposes) then retest your app?
    If you are making a web part based on the new app model this will be an "app part" and probably have the same issues you are experiencing. If this is for something internal rather than a product you are developing to resell then the script editor /
    content editor web part approach could work for you.
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Determine Email of the person in the people field using JSOM or REST API

    Hi,I have to build below HTML dynamically. The source to build this is a sharepoint list that has a people field in it.Can I use JSOM or REST API to do this? if so, can anyone help with some examples?<a href='mailto:[email protected],[email protected]'>Write email</a>
    techie

    Hi,
    The following code for your reference:
    <script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
    var array=new Array();
    var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('CustomList')/items?$select=EmployeeId";
    // execute AJAX request
    $.ajax({
    url: requestUri,
    type: "GET",
    headers: { "ACCEPT": "application/json;odata=verbose" },
    success: function (data) {
    var dataResults = data.d.results;
    for(var i=0;i<dataResults.length;i++){
    if(dataResults[i].EmployeeId!=null){
    for(var j=0;j<dataResults[i].EmployeeId.results.length;j++){
    array.push(dataResults[i].EmployeeId.results[j]);
    //remove the duplicated id
    var employeeIds=$.unique(array);
    //get the employee email by user id
    var emails=getEmailsByIDs(employeeIds);
    //add to send mail div
    $("#SendMail").append("<a href='mailto:"+emails+"'>Send Email</a>");
    error: function () {
    //console.log("Failed to get details");
    function getEmailsByIDs(employeeIds){
    var emails=new Array();
    var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/siteusers?$select=Id,Email";
    // execute AJAX request
    $.ajax({
    url: requestUri,
    type: "GET",
    headers: { "ACCEPT": "application/json;odata=verbose" },
    async: false,
    success: function (data) {
    var dataResults=data.d.results;
    for(var i=0;i<dataResults.length;i++){
    for(var j=0;j<employeeIds.length;j++){
    if(dataResults[i].Id!=null&&dataResults[i].Id==employeeIds[j]&&dataResults[i].Email!=null){
    emails.push(dataResults[i].Email);
    error: function () {
    //console.log("Failed to get details");
    return emails;
    </script>
    <div id="SendMail">
    </div>
    Thanks,
    Dennis Guo
    TechNet Community 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].
    Dennis Guo
    TechNet Community Support

  • REST API POST and GET Error--Retriving following sites news feed

    i have used below code to retrive the newsfeeds but im getting 403 error.i think url formation for POST and GET is wrong.Kindly anyone worked help mee. 
    var feedManagerEndpoint;
    // Get the SPAppWebUrl parameter from the query string and build
    // the feed manager endpoint.
    $(document).ready(function () {
    var appweburl;
    var params = document.URL.split("?")[1].split("&");
    for (var i = 0; i < params.length; i = i + 1) {
    var param = params[i].split("=");
    if (param[0] === "SPAppWebUrl") appweburl = param[1];
    alert(appweburl);
    feedManagerEndpoint = decodeURIComponent(appweburl)+ "/_api/social.feed";
    alert(feedManagerEndpoint);
    postToMyFeed();
    // Publish a post to the current user's feed by using the
    // "<app web URL>/_api/social.feed/my/Feed/Post" endpoint.
    function postToMyFeed() {
    alert('pOST');
    $.ajax( {
    url: feedManagerEndpoint+"/my/Feed/Post",
    type: "POST",
    data: JSON.stringify( {
    'restCreationData':{
    '__metadata':{
    'type':'SP.Social.SocialRestPostCreationData'
    'ID':null,
    'creationData':{
    '__metadata':{
    'type':'SP.Social.SocialPostCreationData'
    'ContentText':'This post was published using REST.',
    'UpdateStatusText':false
    headers: {
    "accept": "application/json;odata=verbose",
    "content-type":"application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val()
    success: getMyFeed,
    error: function (xhr, ajaxOptions, thrownError) {
    alert("POST error:\n" + xhr.status + "\n" + thrownError);
    // Get the current user's feed by using the
    // "<app web URL>/_api/social.feed/my/Feed" endpoint.
    function getMyFeed() {
    alert('get');
    $.ajax( {
    url: feedManagerEndpoint +"/my/Feed",
    headers: {
    "accept": "application/json;odata=verbose"
    success: feedRetrieved,
    error: function (xhr, ajaxOptions, thrownError) {
    alert("GET error:\n" + xhr.status + "\n" + thrownError);
    // Parse the JSON data and iterate through the feed.
    function feedRetrieved(data) {
    var stringData = JSON.stringify(data);
    var jsonObject = JSON.parse(stringData);
    alert(jsonObject);
    var feed = jsonObject.d.SocialFeed.Threads;
    alert(feed.results);
    var threads = feed.results;
    var feedContent = "";
    for (var i = 0; i < threads.length; i++) {
    var thread = threads[i];
    var participants = thread.Actors;
    var owner = participants.results[thread.OwnerIndex].Name;
    feedContent += '<p>' + owner +
    ' said "' + thread.RootPost.Text + '"</p>';
    $("#message").html(feedContent);

    Hi Scott,
    With EnableQueryRules and ProcessBestBets set to true in the search rest api, we can get the promoted results(best bets) in SharePoint 2013.
    I recommend to type the search rest api URL in the browser directly and then check if the best bets are displayed at the top of the search results.
    It will not displayed inside the table for normal results.
    Please also make sure that the query text matches the query rule condition.
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • REST API and best bets / query rules

    Is there a bug in this?  I can not get best bet results regardless of the query string.  For example, the following (according to MSDN documentation) should process the query rules and return a best bet.  But it doesnt.  Am I doing something
    wrong in the query?  It only seems to return ordinary results.  Performing the same search via Sharepoint's UI returns the best bet at the top.
    $.ajax({
    url: "http://myserver/sites/mysite/_api/search/query/?processbestbets=true&enablequeryrules=true&querytext='" + searchText + "'",
    type: 'GET',
    headers: {
    "accept": "application/json; odata=verbose"
    success: myCallback,
    error: function(data) {
    alert(data.responseXML.text);

    Hi Scott,
    With EnableQueryRules and ProcessBestBets set to true in the search rest api, we can get the promoted results(best bets) in SharePoint 2013.
    I recommend to type the search rest api URL in the browser directly and then check if the best bets are displayed at the top of the search results.
    It will not displayed inside the table for normal results.
    Please also make sure that the query text matches the query rule condition.
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • 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 :)

  • Update item in list using rest api - failed when browsing in juniper session

    this issue is about browsing to an on premises sharepoint 2013 inside a LAN using Juniper session
    the user can see everything and can create new list items with rest api but
    cannot update existing items using the function below.
    we've got this function which we use to update list items in rest
    it works like a charm when browsing inside the LAN
    function updateListItem(itemIdentityField, itemIdentity, listName, siteUrl, item, success, failure) {
    getListItemWithId(itemIdentityField, itemIdentity, listName, siteUrl, function (data) {
    $.ajax({
    url: data.__metadata.uri,
    type: "POST",
    contentType: "application/json;odata=verbose",
    data: JSON.stringify(item),
    headers: {
    "Accept": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val(),
    "X-HTTP-Method": "MERGE",
    "If-Match": data.__metadata.etag
    success: function (data) { success(data, callBackIndex, null) },
    error: function (data) {
    getError(data);
    }, function (data) {
    failure(data);
    the error i get in ULS log is:
    Original error: Microsoft.SharePoint.Client.InvalidClientQueryException: The parameter __metadata does not exist in method GetItemByStringId.
    at Microsoft.SharePoint.Client.MethodInformation.GetParameter(String parameterName)
    at Microsoft.SharePoint.Client.ClientCallableEdmModelBuilder.CreateFunctionImportForMethodBodyParser(MethodInformation clientMethod, List`1 parameterNames, ProxyContext proxyContext)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ParseParametersFromBody(MethodInformation methodInfo, Boolean allowPostBodyAccess, Boolean isLeafSegment, ClientValueCollection args)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ParseParametersFromBodyOrQueryString(MethodInformation methodInfo, Boolean allowPostBodyAccess, Boolean isLeafSegment, ClientValueCollection args)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.CreateMethodArgumentsUsingNamedParameters(MethodInformation methodInfo, IList`1 parameterList, Boolean isLeafSegment, Boolean allowPostBodyAccess)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.InvokeMethod(Boolean mainRequestPath, Object value, ServerStub serverProxy, EdmParserNode node, Boolean resourceEndpoint, MethodInformation methodInfo, Boolean isExtensionMethod, Boolean isIndexerMethod)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.GetObjectFromPathMember(Boolean mainRequestPath, String path, Object value, EdmParserNode node, Boolean resourceEndpoint, MethodInformation& methodInfo)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.GetObjectFromPath(Boolean mainRequestPath, String path, String pathForErrorMessage)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.Process()
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ProcessRequest()
    at Microsoft.SharePoint.Client.Rest.RestService.ProcessQuery(Stream inputStream, IList`1 pendingDisposableContainer)
    Any help?
    Somebody?
    Thanks

    Hi patrik
    Really appreciate your replying.
    Could you try and refer to the issues below:
     this error occurs even with site collection administrator (i tested it with three different
    users)
    there isnt any difference between items in list - all have same permissions
    it occurs in several lists in site (all lists have same permissions)
    if browsing inside the LAN everything works just fine
    updating from the UI works fine in all means
    It really seems like a Rest related problem(is there anyone from the Microsoft REST team who can take look at this error?)
    Thanks
    Hushay

  • Extracting Raw Data Using Excel Services REST API

    I am trying to create a home page in SharePoint 2013 that shows quick stats based on an Excel workbook stored in a document library. Through my research I found that I could leverage the Excel Services REST API to pull the information I need from the workbook
    via URIs and display it on a SharePoint page in a seamless manner.
    The problem I am having is pulling the data I need as raw text.
    For example, I can create a page in HTML that says "Our sales for the month grew by [X%]" and use an img src tag that points to
    http://sample.com/_vti_bin/ExcelRest.aspx/Documents/workbook.xlsx/Model/Ranges('Sheet1!A1')?$format=image to show a picture of cell A1 which contains the data I want to show inline on my page.
    I want a way to pull the data in cell A1 as raw text so that I can format it as part of the HTML page. I tried using
    $format=html, but that just takes me to a separate page where the cell is formatted exactly as it is in the workbook.
    Is there a way to do what I am trying to do? The more detailed your response can be, the better as I am fairly new to these features. And also, is there a way to perform calculations of cells in HTML? Thanks in advance.

    Hi,
    According to your description, you might want to extract text value from a specific cell in an Excel file using Excel Services REST API.
    As there is no such predefined format can be used to return text value only, I would suggest you return the value as json format, then parse it and set to your HTML
    tag using jQuery.
    Here is a <p> tag with a script which can set the value of the <p> tag with the value gets from cell “A1”:
    <p id="cell1">test</p>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">
    //replace the strings below with yours
    var libName = "Shared Documents";
    var fileName = "Book1.xlsx";
    var rangeName = "A1";
    $(function(){
    var s = getCellValue(libName, fileName, rangeName);
    $("#cell1").html(s);
    function getCellValue (libName, fileName, rangeName)
    var cell = "";
    $.ajax({
    url: _spPageContextInfo.webAbsoluteUrl + "/_vti_bin/ExcelRest.aspx/"+libName+"/"+fileName+"/model/Ranges('"+rangeName+"')?$format=json",
    method: "GET",
    headers: { "Accept": "application/json; odata=verbose" },
    dataType: "json",
    async: false,
    success: function (data) {
    console.log(data.rows[0][0].v);
    cell = data.rows[0][0].v;
    error: function (data) {
    console.log(data);
    return cell;
    </script>
    You can add it into your page via a Content Editor Web Part, it will take effect after the page loaded.
    Here are two links about how to add code into page via Content Editor Web Part:
    http://blogs.msdn.com/b/sharepointdev/archive/2011/04/14/using-the-javascript-object-model-in-a-content-editor-web-part.aspx
    http://sharepointadam.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp/
    Best regards
    Patrick Liang
    TechNet Community Support

  • Return data is null while calling Exchange Online rest api using jquery on Chrome and Mozilla

    Hi,
         I am developing a SharePoint hosted app in which I am calling Exchange online rest api using basic authentication to get mail for the user. This works fine in IE but returns null data when opening in Chrome or Mozilla.
    Is there something I am missing while making rest call to api?
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. Thanks, Ajeet

    Hi,
    This forum is to discuss problems of Office development such as VBA, VSTO, Apps for Office .etc. But I think your question is related to app for SharePoint. I suggest you posting it in
    App for SharePoint forum for more efficient responses.
    Thanks.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • SAP BO 4.1 Webi report sample with prompts to try Restful api

    I was not able to find, in the report demo samples available in the SAP BO 4.1 installation, a Webi report with prompts.
    I found many Webi reports samples but all are without prompts.
    I need at least one Webi report sample with prompts to try the Restful API http://localhost:6405/biprws/raylight/v1/documents/7090/parameters and http://localhost:6405/biprws/raylight/v1/documents/7090/schedules with parameters body.
    Where can I found such webi sample?
    Thanks,
    Riccardo

    As you have BI 4.1 installed, you could design a sample webi report using Webi Rich Client tool.
    Open Webi rich client, select the sample eFashion universe drag few objects in the query and a filter. Set the filter as a prompt and save the report to Enterprise.
    Now you could now use this sample report for your handson on REST SDK.
    -Bhushan

  • 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

  • How to create list items with multiple attachment files using rest api javascript

    In one of user form I am using javascript rest api to create a list item with multiple attachment files. So far I am able to create list item and once created uploading an attachment file. But this is two step process first create an item and then upload
    a file.
    It create an additional version of the item which is not desired. Also I am not able find a way to attach multiple files in a go. Following is the code I am using.
    createitem.executeAsync({
                    url: "/_api/web/lists/GetByTitle('UserForm')/items(1)/AttachmentFiles/add(FileName='" + aFile.name + "')",
                    method: "POST",
                    contentType: "application/json;odata=verbose",
                    headers: {
                        "Accept": "application/json;odata=verbose",
                        "X-RequestDigest": $("#__REQUESTDIGEST").val()
                    binaryStringRequestBody: true,
                    body: fileContent,
                    success: fnsuccess,
                    error: fnerror
    So somehow I need to combine item attributes along with attachment files in body: param. I visited https://msdn.microsoft.com/en-us/library/office/dn531433.aspx#bk_ListItem but no success.
    Appreciate any help.

    Thanks Mahesh for the reply and post you share it was useful.
    But this does not solve the core of the issue. You are uploading attachments after creation of item and multiple files are being attached in loop. This is kind of iterative update to an existing item with attachments. This will end up creating multiple versions. 
    What I am trying to achieve is to create an item along with multiple attachments in a go. No item updates further to attach a file.
    Please suggest how this can be done in one go. SharePoint does it when one creates an item with multiple attachment.
    Thanks for your reply.

Maybe you are looking for

  • Retieve data from Palm Zire m150

    My computer crashed and just got a new MAC. Since computer was bought recently, I had not hot-synced my data. I haven't used my Palm for awhile, but was keeping it charged to preserve memory.  This last time that I charged it, I discovered that one o

  • Download suddenly very slow

    I have experienced a slowness in downloading video files. What actually happens?

  • What are NSSA and TNSSA area?

    What is the significance of these? What kind of LSA types can be advertised in these areas in OSPF?

  • I am using ipad , my desktop do not have App Store icon, how can I got it

    I am using ipad , my desktop do not have App Store icon, how can I got it, I can not brows App Store, I can not download free software

  • Safari will not open any more

    I was using safari fine until 8.30pm last night when suddenley I got the spinning ball of death and the words application not responding. I had to force quit. When then thrying to re open safari it just bounced in the dock. When I checked on the cons