Creating Article
Published on by Djordje Grubac, Employee at Tallyfox
Adding taxonomies to articles, blogs, or any other content type must be handled using Taxonomy API to get desired taxonomy and then sending Taxonomy API response as Taxonomy parameter value in Article or other API.
Go to /api-doc and click on Articles link that is displayed. This will take you to Articles section.
Click on POST to expand API method for creating articles. This will expand the section where are explained formats, parameters and server responses.
Here you can find end-point and parameters that can be passed to API. Data can be returned in json, xml or html format.
Pre-requisites
Logged in as active user with authentication key
Parameters
Parameter | Required | Type | Description |
title | Yes | String | Article title |
description | Yes | String | Article content. HTML can be passed. |
embeded | No | Array | Article can be created using external URL. In that case external URL should be passed as embeded parameter. |
taxonomy | No | Array | Array of taxonomies . |
classifying | No | String | Category eid. Can be obtained using categories API. |
objectModel |
| String |
|
objectId |
| String |
|
mentions[] | No | Array | Array of persons that are mentioned in the article. |
media | No | Array | Array of media eid. Used if article have attachments. |
draft | No | String |
|
preview | No | Bool |
|
_format |
|
|
|
Example request in JSON - simple:
{ "title": "Simple article title", "description": "Simple article content can contain almost anything. Images are inserted as HTML img element.", "classifying": "0pRuMXuwJ89y-vm3FNILuA", "status": "published" }
Example response:
{ "classifying": { "color": "#07beee", "eid": "0pRuMXuwJ89y-vm3FNILuA", "icon": "icon-business-o", "instance": { "domain_name": "test.thewaternetwork.com", "eid": "hkd3YM7b__PZAnjtOiHuUg", "has_logo": true, "instance_private": true, "logo": { "content_type": "image/png", "counters": { "comments": 0, "likes": 0 }, "created_at": "2017-01-23T16:20:12+0100", "eid": "_MMbUqaAQod4PccBhxv44w", "like": false, "name": "sanitation-clipart-13547825911734362521edit(121196)-md.png", "permissions": [], "whoami": "Application\\Sonata\\MediaBundle\\Entity\\Media" }, "member": true, "name": "Test", "type": "cluster", "whoami": "TFX\\InstanceBundle\\Entity\\Instance" }, "name": "Business", "position": 1, "whoami": "TFX\\TaxonomyBundle\\Entity\\Classifying" }, "counters": { "comments": 0, "likes": 0 }, "created_at": "2017-09-11T11:47:00+0200", "created_by": { "eid": "6mHqCTbw96L1LjLTM9mv3Q", "first_name": "Djrodje", "has_photo": true, "instance": { "domain_name": "test.thewaternetwork.com", "eid": "hkd3YM7b__PZAnjtOiHuUg", "has_logo": true, "instance_private": true, "logo": { "content_type": "image/png", "counters": { "comments": 0, "likes": 0 }, "created_at": "2017-01-23T16:20:12+0100", "eid": "_MMbUqaAQod4PccBhxv44w", "like": false, "name": "sanitation-clipart-13547825911734362521edit(121196)-md.png", "permissions": [], "whoami": "Application\\Sonata\\MediaBundle\\Entity\\Media" }, "member": true, "name": "Test", "type": "cluster", "whoami": "TFX\\InstanceBundle\\Entity\\Instance" }, "last_name": "Grubac", "name": "Djrodje Grubac", "photo": { "content_type": "image/jpeg", "counters": { "comments": 0, "likes": 0 }, "created_at": "2017-08-30T11:53:07+0200", "eid": "DJd6BYJgK9dDkG_85ILurA", "like": false, "name": "07b0ed2.jpg", "permissions": [], "whoami": "Application\\Sonata\\MediaBundle\\Entity\\Media" }, "ranking_score": 0.9, "slug": "djrodje-grubac", "whoami": "TFX\\UserBundle\\Entity\\User" }, "description": "Simple article content can contain almost anything. Images are inserted as HTML img element.", "eid": "zFOPftsX8sgEGglMrKgpvg", "following": "dWjj74G2HBLrbWBD53hUVw", "has_taxonomy": false, "has_url": false, "instance": { "domain_name": "test.thewaternetwork.com", "eid": "hkd3YM7b__PZAnjtOiHuUg", "has_logo": true, "instance_private": true, "logo": { "content_type": "image/png", "counters": { "comments": 0, "likes": 0 }, "created_at": "2017-01-23T16:20:12+0100", "eid": "_MMbUqaAQod4PccBhxv44w", "like": false, "name": "sanitation-clipart-13547825911734362521edit(121196)-md.png", "permissions": [], "whoami": "Application\\Sonata\\MediaBundle\\Entity\\Media" }, "member": true, "name": "Test", "type": "cluster", "whoami": "TFX\\InstanceBundle\\Entity\\Instance" }, "like": false, "permissions": [ "CREATE", "CREATE_PUBLISHED", "DELETE", "EDIT", "VIEW", "VIEW_LIST" ], "short_description": "Simple article content can contain almost anything. Images are inserted as HTML img element.", "slug": "simple-article-title-1", "smart_match": 0, "status": "published", "title": "Simple article title", "total_view_count": 0, "view_count": 0, "view_count_anonymous": 0, "whoami": "TFX\\ContentBundle\\Entity\\Article" }