1

Here's what I did so far. I got the access token in Postman using the Connected App. I then send a request to

/services/data/v47.0/support/knowledgeArticles

Here I could only find groupLabels and other things and the articleType field is returning the knowledge base such as "knowledge__kav" not the actual Articles Record Types.

Knowledge Articles Record Types

I had already gone through this question and several other links but to no avail.

But the things mentioned in it didn't work out for me.

0

You should be able to pull this info in the REST API with the normal sobjects/describe endpoint. You do need to check what your actual API name is for your Knowledge object as it may be set differently.

To do this, go to Setup --> Object Manager. Find Knowledge and see what the API name is.

enter image description here

Use this value in the below:

/services/data/v47.0/sobjects/FAQ__kav/describe

You should see recordTypeInfos returned:

enter image description here

An easy way to test with this and see what you get returned is to use workbench. Select Utilities --> REST Explorer and you can see the returned results and whether you have a valid call.

enter image description here


If you need to then query records based on the recordTypeID, you can use the query resource within the REST API. This'll work just like any other SOQL query you'd do to find record.

SELECT Id,KnowledgeArticleId FROM FAQ__kav WHERE RecordTypeId = 'whatever record type ID'

In REST API, that would be:

/services/data/v47.0/query?q=SELECT+Id,KnowledgeArticleId+FROM+FAQ__kav+WHERE+RecordTypeId='record type ID you want'

The return value from the REST API would be in the format of

{
  "totalSize" : 94637,
  "done" : false,
  "nextRecordsUrl" : "/services/data/v47.0/query/whateverId-2000",
  "records" : [ {
    "attributes" : {
      "type" : "FAQ__kav",
      "url" : "/services/data/v47.0/sobjects/FAQ__kav/whateverId"
    },
    "Id" : "id of version",
    "KnowledgeArticleId" : "id of knowledgearticle"
  }, //and so on in this format
  • is there any method to get the list of article ID associated with a record type? or get the record type from an article ID? – Akshay Rathnavas Jan 13 at 6:06
  • you can execute a query with the REST API – Kris Goncalves Jan 13 at 11:30
  • I am fairly new to this, when I tried executing, I am getting an error that the field doesn't exist or something. Could you be kind enough to tell me the query or guide me as to where to get it? – Akshay Rathnavas Jan 13 at 11:33
  • I've edited my answer, but It might be better to create a new question if you have other issues outside of the initial scope of this one. – Kris Goncalves Jan 13 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.