Follow

Update Article

 

The Update Article command allows you to make changes to an existing article.  The command allows you to specify several components of an article, such as Callout and Body.  

Arguments

The updatearticle command requires the following arguments: Command, Realm, Password, and Article Name.

api_web?r=myrealm&p=mypass&c=updatearticle&article_name=MyArticle

The command is ‘updatearticle’, the realm is ‘myrealm’ and the password is ‘mypass’.  The article named ‘MyArticle’ will be updated with no content in each field.

An important note about the Update command is that if you do not include an argument, the content in that field will be cleared.  If you do not wish to clear your article content, be sure to include all commands and the content you expect to be saved.

The Create Article commands support the following arguments:

 

Name

Req?

Description

Argument

Command

Yes

Defines the command to use.

cmd=[updatearticle]

c=[updatearticle]

Realm

Yes

Name of the realm to run the command.  This is required, and the command will fail if the realm and password do not match.

realm=[realm_name]

r=[realm_name]

Password

Yes

Authentication code for API access.  This is required, and the command will fail if the realm and password do not match.

pwd=[password]

p=[password]

Article Name

Yes

Name of the article to update. To include spaces, use + or %20 to avoid possible issues with spaces in a URL.

article_name= [article_name]

Title

 

Title of the article.

article_title=[article_title]

Description

 

Internal description of the article.

article_description=[article_description]

Deck

 

Deck text for the article.

deck=[article_deck]

Callout

 

Callout text for the article.

callout=[article_callout]

Body

 

Body content of the article.  Can be created as plain text or HTML.

article_body=[article_body]

Author Name   Name of the article author. author_name=[author_name]
Author Bio   Biography for the article author. author_bio=[author_bio]
Author Email   Email of the article author. author_email=[author_email]
Folder   Identifier of the Folder to associate the Creative for organization.  Default folder is 0, or Unfiled. folder_id=[folder_id]

 

Example

Using all commands and arguments (please note the command is wrapped for display purposes only):

api_web?r=myrealm&p=mypass&c=updatearticle&article_name=myarticle&article_title=Title%20Updated&article_description=Test%20Updated&deck=Deck%20Updated&callout=Callout%20Updated&article_body=Body%20Content%20Updated&author_name=Jane&author_bio=Me&author_email=jane%40domain.com&folder_id=0

Successful results return, where ‘42’ is the ID of the changed article:

SUCCESS: 42

This is a very simple example.  You can also POST the values, which allows you to send much larger body data.

Results

The Update Article command outputs either a SUCCESS or FAILURE message. 

SUCCESS

The Update Article command success message returns the id of the new article.  The result format is:

SUCCESS: [article_id]

FAILURE

A Update Article command will fail if an article does not exist.  The result format is:

FAILURE: [Reason]  

 
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk