Publish or Unpublish a Program
patch
/rest/api/v1.3/programs/{programName}
Use this interface to publish a valid program or unpublish a program.
Request
Supported Media Types
- application/x-www-form-urlencoded
Path Parameters
-
programName: string
Name of the Program to be published or unpublished
Root Schema : update-program-request
Type:
objectTitle:
Show Source
update-program-request-
action(optional):
string
Allowed Values:
[ "publish", "unpublish" ]Action to be performed on a given program -
saveDraft(optional):
string
Allowed Values:
[ "Y", "N" ]Indicates whether to save the draft version or published version
Response
Supported Media Types
- application/json
Default Response
Root Schema : update-program-response
Type:
objectTitle:
Show Source
update-program-response-
errorMsg(optional):
string
Error messages when publish or unpublish fails
-
status(optional):
string
Allowed Values:
[ "SUCCESS", "FAILURE" ]Returns SUCCESS if the publish or unpublish is successful. Returns FAILURE if action is not successful.
Examples
This interface is used to publish and unpublish programs.
A successful request requires the following headers:
| FIELDS | DESCRIPTION |
|---|---|
| Authorization | <AUTH_TOKEN> |
| Content-Type | application/json |
Sample Request Body:
Publish a program.
{
"action": "publish",
"saveDraft": "Y"
}
Sample Response: Success
{
"status": "SUCCESS",
"errorMsg": []
}
Sample Response: Failure
In the following sample response body, the request parameter action was not set to 'publish' or 'unpublish'.
{
"type": "",
"title": "Invalid request parameters",
"errorCode": "INVALID_PARAMETER",
"detail": "Request parameter 'action' should be set as 'unpublish' or 'publish'",
"errorDetails": []
}