This version of the API is deprecated.

See text.create for the current version of this method.

corpus.addArticle

Add a new article to a Corpus.

Request Parameters

Corpus IDint (required)

The unique id for the corpus you want to add the article to.

BodyString (required)

Body text for the article. Maximum 100 000 chars.

LanguageString (required)

The language for the article. English and Swedish are supported and specified according to ISO 639-1. Swedish = "sv", English = "en".

HeadlineString

Title for the article. Maximum 250 chars.

LeadString

Lead text for the article. Maximum 2000 chars.

Publish DateString

The date for when the article was published. (YYYY-MM-DD HH:MM:SS, i.e. 2010-01-24 12:23:44)

Publish URLString

The url for where the article can be found on internet

AuthorsString

The authors of the article

Response Parameters

articleIdint

The id your newly added article got in your Corpus.

Code Examples

JSON


//Request

//This is an example where all params have been provided.
{
 "method":"corpus.addArticle",
 "params":[45,"this is my headline", "this is the lead text", "this is the body text", "2010-01-24 12:23:44", "http://saplo.com/news/this-is-my-headline/", "Fredrik", "en"],
 "id":0
}

//This i an example where only the required params have been provided.
{ 
 "method":"corpus.addArticle",
 "params":[45,"", "", "this is the body text", "", "", "", "en"],
  "id":0
}




//Response
{"id":0,"result":{"articleId":1}}

Notes

  • If you want to be able to see the articles using the method corpus.getArticle then make sure to provide a headline.
  • Your articleId combined with your corpusId is unique.