function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jordan VasquezJordan Vasquez 

How do I publish a draft article via REST?

Hello,

I am trying to publish a draft Master Version of one of my articles but I am hitting a problem. Specifically, I am returned the following error from Salesforce:
[
    {
        "message": "Unable to create/update fields: PublishStatus. Please check the security settings of this field and verify that it is read/write for your profile or permission set.",
        "errorCode": "INVALID_FIELD_FOR_INSERT_UPDATE",
        "fields": [
            "PublishStatus"
        ]
    }
]
I am able to update the rich text content block but I am unable to publish the draft article. Following the doucmentation from this: https://developer.salesforce.com/docs/atlas.en-us.knowledge_dev.meta/knowledge_dev/knowledge_REST_publish_master_version.htm it looks like I should be able to.

I attached a picture of my call from within Postman. I have two separate calls that updates my Content__c custom field and then publishes the article if the update was successfuly. The update to my Content__c field is successful but the call to publish is not working.

User-added image

Any reason why?
Best Answer chosen by Jordan Vasquez
Jordan VasquezJordan Vasquez
DUH! Found my problem, hitting the wrong endpoint!

For anybody curious, this is the endpoing you need to hit: /services/data/v25.0/knowledgeManagement/articleVersions/masterVersions/

All Answers

Jordan VasquezJordan Vasquez
Quick thing I wanted to note. I made sure that my user had access to update knowledge articles and had the correct permissions to perform REST updates so that isn't it either. 
Jordan VasquezJordan Vasquez
DUH! Found my problem, hitting the wrong endpoint!

For anybody curious, this is the endpoing you need to hit: /services/data/v25.0/knowledgeManagement/articleVersions/masterVersions/
This was selected as the best answer