+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / create news from my web application

create news from my web application

4 posts, 0 answered
  1. Paolo
    Paolo avatar
    1 posts
    Registered:
    11 Oct 2011
    26 Oct 2011
    Link to this post
    I need to create news in sitefinity database from my web application,

    can I use web services to do this?

    for example:
    var usersService = new WebChannelFactory<IUsers>("http://mysite.it/Sitefinity/services/UserProfiles/UserProfileTypesService.svc");
                var usersChannel = usersService.CreateChannel();
                var auth = usersChannel.AuthenticateUser(new Telerik.Sitefinity.Security.Credentials() { UserName = "user", Password = "password", Persistent = true });

    EndpointAddress address = new EndpointAddress("http://mysite.it/Sitefinity/services/Content/NewsItemService.svc/");
    What is the News Interface to insert in ChannelFactory ?

    Or is it better to use newManager?
    for example:
    NewsManager newsManager = new NewsManager("News");
    NewsItem newsItem = newsManager.CreateNewsItem();

    In this case how can I connect to sitefinity database?


    thanks!


  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    28 Oct 2011
    Link to this post
    Hello Paolo,

    It is not very easy to create news items using our services, so I can recommend you to use either the Fluent or Native API. If you correctly write the code it will create all necessary records in the database. Please consult the following article:

    http://www.sitefinity.com/40/help/developers-guide/sitefinity-essentials-modules-news-creating-news-items.html

    Greetings,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. David
    David avatar
    9 posts
    Registered:
    05 Jun 2013
    12 Jun 2013 in reply to Victor Velev
    Link to this post
    Hello Victor,
    Allthough it may not be very easy to create news using the web services, is it possible? For someone who is skilled with JSON/WCF and other scripting languages, it may be easier for them to use web services than learning and implementing the API's.

    If it is possible, can you help me find a sample of HTTP Push to NewsItemService.svc that creates a News Item.

    Thanks,
    Dave
  4. Lilia Messechkova
    Lilia Messechkova avatar
    42 posts
    Registered:
    13 Jul 2016
    13 Jun 2013
    Link to this post
    Hello David,

    Please refer to the following article to create a news item through our rest service: http://www.sitefinity.com/blogs/svetla-yankovas-blog/2011/11/01/getting_started_with_restful_services_in_sitefinity

    Here is an additional link that you may find useful: http://www.sitefinity.com/blogs/svetla-yankovas-blog/2013/01/02/working-with-restful-services-part-2-claims-authentication-and-designing-service-calls

    Regards,
    Lilia Messechkova
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
4 posts, 0 answered