You need to sign in to do that
Don't have an account?
![Tirumala Kuppani 10 Tirumala Kuppani 10](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
How to get the Knowledgebase documents through REST API
Hello
Req: get the Knowledgebase documents through REST API.
I was strusk at get the Knowledgebase documents through REST API.
Please find below Webservice class for get the Knowledgebase documents.
@RestResource(urlMapping='/KB/*')
global with sharing class KBDetails {
@HttpGet
global static List<RMA_Policy__kav> kbDetails() {
String pblist = RestContext.request.params.get('pblist');
// system.debug('localPublishStatus : '+localPublishStatus );
List<RMA_Policy__kav> kbDetailsList = [select id, ArticleNumber, ArticleType, Title, Summary,Question__c,Answer__c, knowledgeArticleId from RMA_Policy__kav where PublishStatus=:pblist];
system.debug('kbDetailsList : '+kbDetailsList );
return kbDetailsList;
}
}
Kindly let us know how to get the KB documents hrough REST API
Any help will be appreciated.
Regards
Tirumala
Req: get the Knowledgebase documents through REST API.
I was strusk at get the Knowledgebase documents through REST API.
Please find below Webservice class for get the Knowledgebase documents.
@RestResource(urlMapping='/KB/*')
global with sharing class KBDetails {
@HttpGet
global static List<RMA_Policy__kav> kbDetails() {
String pblist = RestContext.request.params.get('pblist');
// system.debug('localPublishStatus : '+localPublishStatus );
List<RMA_Policy__kav> kbDetailsList = [select id, ArticleNumber, ArticleType, Title, Summary,Question__c,Answer__c, knowledgeArticleId from RMA_Policy__kav where PublishStatus=:pblist];
system.debug('kbDetailsList : '+kbDetailsList );
return kbDetailsList;
}
}
Kindly let us know how to get the KB documents hrough REST API
Any help will be appreciated.
Regards
Tirumala
Your code seems ok. Go to Workbench and test it with the URL
/services/apexrest/KB/<Pass the published status >
Example : -
/services/apexrest/KB/draft