Use API from other (non web) app? - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Use API from other (non web) app?

  • Use API from other (non web) app?
  • I am trying to use the Sitefinity API from within a Non Sitefinity application, to get at the data.  However, I can't figure out configuration necessary to do this?  I have tried including the config files from app_data/Sitefinity but get errors.   
    Is this possible?  

    Thank You
  • Hello Eric,

    You have to use web services calls to access the content data. There are built-in services that you can use.
    Note that you should be authenticated when you want to work with the API, so I suggest that you should check this post.


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  • Thank You for the response, however I am also having problems authenticating the Web Services?  

    The code examples I have seen seem to be calling from client, but I am trying to call from another Application:
    www.sitefinity.com/.../client-side-programming-working-with-web-services.html

    I call the web services and get a http 412 error:  Pre-condition not met 

    I have tried localhost/.../ and a variety of other things.  

    Thank You




  • Hi Eric,

    Using the code from one of the posts I sent you, you should be able to authenticate yourself. If you type help  after the service you will  be able to see the parameters that you have to pass.

    1. You can access the service with javascript by using Sys.Net.WebRequest() or/and
    2. Using server side code  and making HttpWebRequest



    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  • I have tried that code (the 2nd http web request block) exactly, and with modifcations for just http GET:

    If I make the request with http get I get http 412 error:   Status Code:412 ..::login|session|expired::../Sitefinity/Login/Ajax

    If I make the request with http POST i get http 405 method not allowed error

    I checked the web.config which has the webDav module removed.
  • Hi Eric,

    The error you see is thrown by RequestAuthentication() static method of ServiceUtility class. You get a WebProtocolException when SystemManager.CurrentHttpContext.User.Identity.IsAuthenticated. The user you use is not authenticated.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  • Thank you for the response.

    How do I authenticate the service call, it is coming from a different application.   So, i need to be able to authenticate the service calls programatically using an admin or service account.  Is there a way to "logon" programitcally to create a cookie which I can add to the service calls?   

    Thank You
  • Hello Eric,

    I do not see what would be the problem if you use the code attached in one of the posts I sent you. Can you tell me what would stop you from using such a model to authenticate a user?
    Getting the cookie will not do the trick, because you need to supply username and password to AuthenticateUser method.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.