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

Similar Messages

  • Sharepoint break REST API connection (anonymous), possible bug in sharepoint

    Hello, I have following problem when I test Rest API using fiddler :
    As i see, server just close connection and does not return any status code at all. I expect to see at least 401 or 500 exception. Is that SharePoint
    bug, or this is expected behavior of the SharePoint? (according HTTP protocol & according SharePoint Rest API )
    Web application settings and site collection settings:

    Hi,
    Can you access the site from browser?
    If you can, would you mind providing more details about how you execute your request? Anonymous or with credential?
    How about setting the “Anonymous Access” to “Anonymous users can access Entire Web site”? It would allow anonymous users access the site.
    Feel free to reply if the issue still exists.
    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.

  • Invoking a rest api from BPEL

    Has anybody tried to acess rest api from BPEL , if yes how?
    Has anybody have done integration with HBASE database

    Yes you can call Restful services from SOA 11g bu using HTTP binding that supports both GET and POST operation.
    See the blog below that explains it
    http://rajbpelblog.blogspot.com/2010/10/http-binding-in-soa11g.html

  • Using REST API to promote Document Properties into SharePoint document library

    Hi,
    Is it possible to extract Document properties of a file and update library column using REST API?
    Thanks,
    techie

    Hi,
    We can use the following REST endpoint to get document property:
    http://site/_api/web/getfilebyserverrelativeurl('/Shared Documents/filename.docx')/<property name>
    https://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx#bk_File
    If you want to update document library column, the following blog for your reference:
    Updating SharePoint List items with SharePoint’s REST API in JavaScript
    http://community.rightpoint.com/blogs/viewpoint/archive/2014/10/23/updating-sharepoint-list-items-with-sharepoint-s-rest-api-in-javascript.aspx
    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

  • 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

  • I am not receiving security rest question from apple

    i am not receiving security rest question from apple, i need to buy some app. please help

    Read here  >  Apple ID: All about Apple ID security questions
    If necessary
    1)  See Here > Apple ID: Contacting Apple for help with Apple ID account security
              Ask to speak with the Account Security Team...
    2)  Or Email Here  >  Apple  Support  iTunes Store  Contact
    Note:
    You can only set up a Rescue Email BEFORE you forget the questions/answers.

  • 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

  • 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 - Abhishek

    Many 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

  • SharePoint 2010 REST API, User SiteColumn not coming

    When Create User sitecolumn from front end(using default SharePoint Setting area) and then fetch list through REST API then it comes parfactly but
    When I create User sitecolumn's xml from Visual Studio and then add that sitecolumn in contenttype and then in list and then fact list through REST API then it does come in api xml.

    Hi Manish<o:p></o:p>
     <o:p></o:p>
    I can understand your issue, but not sure what could be the reason behind this behavior. To help you resolve the issue, we will need troubleshooting to be done at your end. I would request you
    to open a support ticket with Microsoft to help us resolve your issue as quickly as possible.
    For more information about Microsoft Support please read the article http://support.microsoft.com/gp/proffaq/en-gb
     <o:p></o:p>
    Thanks,
    Bharat Rathod, <u1:p></u1:p><o:p></o:p>
    Microsoft Online Community Support<u1:p></u1:p><o:p></o:p>

  • SharePoint 2010 Rest API: How to add attachment to a list item via ListData.svc

    Hi
    I have set up a project using the REST API in c# Visual Studio 2010.
    I have added a service reference to the URL //site/_vti_bin/listdata.svc/
    I can query the list and get back data, but I can't retrieve the attachments.
    I can write data to the list, but I can't add attachments.
    Are there any examples of how to add or retrieve attachments using the REST API services.
    Thanks
    Mike

    Hi,                                                             
    If you want to work with list attachments using REST API, here are some links will show how to do this using Javascript:
    http://msdn.microsoft.com/en-us/library/office/dn292553.aspx#FileAttachments
    http://chuvash.eu/2013/02/20/rest-api-add-a-plain-text-file-as-an-attachment-to-a-list-item/
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/06/27/how-to-get-list-item-attachments-using-rest-and-javascript-in-sharepoint-2013.aspx
    Best regards
    Patrick Liang
    TechNet Community Support

  • Sharepoint angulr REST API update file item userd field property

    Hi All,
    I'm working on a project using SharePoint with angular to upload files to document library, for now every thins is working fine and good but when updating the related item fields I was using JSOM its work but it increase the version # of the file which is
    not acceptable to the client I found a solution to update the fields using REST without increasing the version # but the problem am facing now updating a user field it does not take the value it go to the success function but the field not set
    here's my code
     $scope.updateMetadataNoVersion=function(fileUrl) {
        var fld=$scope.SelectedFolder.replace(_spPageContextInfo.siteAbsoluteUrl, "");
           var restSource ="";
            if(fld.replace("lists/DepartmentDocuments","")=="")
           restSource = currentWeb.get_url() + "/_api/web/lists/getbytitle('DepartmentDocuments')/rootfolder/files/getbyurl(url='" + fileUrl + "')/listitemallfields/validateupdatelistitem";
    else
           restSource =  currentWeb.get_url() + "/_api/web/getfolderbyserverrelativeurl('"+fld+"')/files/getbyurl(url='" + fileUrl + "')/listitemallfields/validateupdatelistitem";
            var dfd = $.Deferred();
            $.ajax(
                'url': restSource,
                'method': 'POST',
                 'data': JSON.stringify({
                    'formValues': [
                        '__metadata': { 'type': 'SP.ListItemFormUpdateValue' },
                        'FieldName': 'ShareWith',
                        'FieldValue': '24'
                    'bNewDocumentUpdate': true,
                    'checkInComment': ''
                'headers': {
                    'accept': 'application/json;odata=verbose',
                    'content-type': 'application/json;odata=verbose',
                    'X-RequestDigest': $('#__REQUESTDIGEST').val()
                'success': function (data) {
                    var d = data;
                    dfd.resolve(d);
                'error': function (err) {
                    dfd.reject(err);
                    console.log(err);
            return dfd.promise;
    any help please im search about this since 3 days with no success
    Thanx in advance
    khatib7

    Yes, your correct. The validateupdatelistitem method does not work with Lookup values. You will have to use the standard way of updating the list item via REST but it will increment the version. I agree with you that many customers want to upload files and
    set data without creating 2 versions.  This is how SharePoint upload works. However, the only way to do this with REST is to use the validateupdatelistitem method.
    You can make a request for this to be added to SharePoint at User Voice:
    http://officespdev.uservoice.com/
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • Calling REST APIs from ABAP

    Hi
    We have an application which provides a simple REST (REpresentational State Transfer) based API to facilitate data consumption and external application integration.  Queries to the API are made by passing URLs via standard HTTP GET requests.
    I am using methods from class CL_HTTP_CLIENT.
    How to create client ? by which method ?
    Can you share sample report  ?
    ( Note: I am using ABAP 6.2)
    Thanks.

    by which method , Create_by_destinations or create_by _url . ?
    I tried using both method. but while receiving response i get an error :'communication_failure '

  • Call IDM Rest API from ABAP

    Good day experts,
    We have a requirement to add privileges to users in IDM via a call from a SAP GRC system
    Does anyone have example code of such a call in an ABAP function module?
    Thanking you in advance,
    Johan Kriek

    Martin,
    Thanks for your reply.
    I tried the Web Service way of doing it, seems to be working alright but again it comes with all the security issues and all around the Web Service.
    I am exploring the use of JCO RFC Service provider, to call a JAVA program from ABAP. Hopefully that should work.
    Thanks again.
    John Miller

  • 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.\"}}}"
    Navaneeth

    Finally 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

Maybe you are looking for

  • Service Desk Configuration (Raising message from R3 system)

    Hi, I want to configure my R3 system, so that when I create a support Message it is reflected in Solution Manager. I have done the following steps, in R3 system 1) Use transaction SM30 and modify BCOS_CUST table. Entries in this table are Col 1: OSS_

  • How to implement secure help in SharePoint 2010?

    Hi, We are having a sharepoint site running over HTTPS. When I click on help link given on top right side, I get a security warning saying that only secure content content can be displayed. This is probably due to the non secure content(http) used by

  • Setting Filter on an Alert

    Hi, I am trying to create an alert programatically. When I set a CAML query as the filter condition, it always gives an error The error message says - The filter cannot be parsed. Check the filter syntax, and try again. If I try to add an alert progr

  • Buying a new Mac Pro

    Hello, After many happy years with my G4 and using my MacBook Pro for higher end editing I am finally getting around to replacing the G4 with a brand new Mac Pro. It will be used manly for video editing so I will get the best model available. Here is

  • Flash Player From Start Screen...

    I woud like to be able to play games or watch videos from my start screen, it keeps telling me to update my flash player, but I have the most updated one. when i do go to the flash player page all i get is a an empty box. i dont seem to have a proble