Reading custom modules using REST API

Posted by Community Admin on 04-Aug-2018 07:38

Reading custom modules using REST API

All Replies

Posted by Community Admin on 27-May-2016 00:00

Hi everyone,


Can someone explain to me How can I get the dynamic module names using the available rest API or the usage of

GET /restapi/sitefinity/related-data/data-types.


Thanks,
Balu

Posted by Community Admin on 31-May-2016 00:00

Hi, 
Could you please elaborate on what you are trying to achieve in the end ? 
 
You can also use the ContentTypeService.svc directly, 
eg.
http://<yourhost>:<yourport>/Sitefinity/Services/DynamicModules/ContentTypeService.svc/
 
which returns, amongst others, the ContentTypeTitle.
 
Additional doc links:
 
Create a RESTful WCF service to retrieve titles of news items
http://docs.sitefinity.com/tutorial-create-a-restful-wcf-service-to-retrieve-titles-of-news-items
 
Related data API
http://docs.sitefinity.com/for-developers-related-data-api


Regards,
Dimitri Cools
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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 02-Jun-2016 00:00


Hi Dimitri,

Thank you. I am trying to read the all dynamic modules which are available in Sitefinity using angular JS.
I was using localhost:60876/.../data-types to get the all modules which are available.
Once I hit the above URL, I am getting a web page as a response and a hyper link(view json datasource). On clicking hyperlink, it is giving JSON response.


Please find the attached snapshot which I get after hitting the response.

Sample JSON Response:

["ClrType":"Telerik.Sitefinity.News.Model.NewsItem","Name":"News","Providers":["Name":"OpenAccessDataProvider","Title":"Default News"],"ClrType":"Telerik.Sitefinity.Blogs.Model.BlogPost","Name":"Blog Posts","Providers":["Name":"OpenAccessDataProvider","Title":"Default Blogs"],"ClrType":"Telerik.Sitefinity.Events.Model.Event","Name":"Events","Providers":["Name":"OpenAccessDataProvider","Title":"Default Events"],"ClrType":"Telerik.Sitefinity.Pages.Model.PageNode","Name":"Pages","ParentName":"Page","Providers":["Name":"OpenAccessDataProvider","Title":"OpenAccessDataProvider"],"ClrType":"Telerik.Sitefinity.DynamicTypes.Model.Bala.Balu","Name":"BAlus (Bala)","ParentName":"Bala","Providers":["Name":"OpenAccessProvider","Title":"Default"],"ClrType":"Telerik.Sitefinity.DynamicTypes.Model.sf_ec_prdct_book","Name":"Book","Providers":["Name":"OpenAccessDataProvider","Title":"Default Ecommerce products"],"ClrType":"Telerik.Sitefinity.DynamicTypes.Model.sf_ec_prdct_generalproduct","Name":"General product","Providers":["Name":"OpenAccessDataProvider","Title":"Default Ecommerce products"],"ClrType":"Telerik.Sitefinity.DynamicTypes.Model.sf_ec_prdct_software","Name":"Software","Providers":["Name":"OpenAccessDataProvider","Title":"Default Ecommerce products"],"ClrType":"Telerik.Sitefinity.DynamicTypes.Model.sf_ec_prdct_song","Name":"Song","Providers":["Name":"OpenAccessDataProvider","Title":"Default Ecommerce products"]]


Please help me how to get the JSON as a response instead of WebPage.


Posted by Community Admin on 03-Jun-2016 00:00

Hi, 

In order to get list of all methods that a service exposes, you can use a web browser that supports XML response, such as IE or Firefox, and open the following address of a web service:
yourserver/.../help

eg.
IContentTypeService: GetModules
Gets all the content types for the given provider. The results are returned in JSON format.
(http://<host>:<port>/Sitefinity/Services/DynamicModules/ContentTypeService.svc/help/GetModules/response/example)


Regards,
Dimitri Cools
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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed