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 ID | int (required) |
The unique id for the corpus you want to add the article to.
| Body | String (required) |
Body text for the article. Maximum 100 000 chars.
| Language | String (required) |
The language for the article. English and Swedish are supported and specified according to ISO 639-1. Swedish = "sv", English = "en".
| Headline | String |
Title for the article. Maximum 250 chars.
| Lead | String |
Lead text for the article. Maximum 2000 chars.
| Publish Date | String |
The date for when the article was published. (YYYY-MM-DD HH:MM:SS, i.e. 2010-01-24 12:23:44)
| Publish URL | String |
The url for where the article can be found on internet
| Authors | String |
The authors of the article
Response Parameters
| articleId | int |
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.