Skip to content

api_articles_id

Nikola Hardi edited this page Feb 11, 2015 · 15 revisions

Endpoint for accessing particular article by ID. Article ID can and should be extracted from the URL.

/api/v1/articles/:id

Implements GET and PATCH.

GET

Should get info on particular Article.

client ---> server
{
  "verbosity" : 0,
}

client <--- server - { "verbosity" : 0 }
{
  "id"             : 128,
  "author"         : 3,
  "state_id"       : 3,
  "section_id"     : null,
  "serie"          : {"id" : null, "part" : null},
  "issue_id"       : 18,
  "titles"         : [
                      { "language_id" : 1, "id" : 18  }, 
                      { "language_id" : 2, "id" : 23  },
                     ],
  "contents"       : [
                      { "language_id" : 1, "id" : 512 }, 
                      { "language_id" : 2, "id" : 128 },
                     ],
}


client <--- server - { "verbosity" : 1 }
{
  "id"             : 128,
  "author"         : { "id" : 3, "name" : "Author Authorous" },
  "state_id"       : 3,
  "section_id"     : null,
  "serie"          : {"id" : null, "name" : "Serie name", "part" : null},
  "issue_id"       : 18,
  "titles"         : [
                      { "language_id" : 1, 
                        "name"        : "Title of article",   
                        "id"          : 18,
                      }, 
                      { "language_id" : 2,
                        "name"        : "Title of article 2", 
                        "id"          : 23 },
                     ],
  "contents"       : [
                      { "language_id" : 1, "id" : 512 }, 
                      { "language_id" : 2, "id" : 128 },
                     ],
}


client <--- server - { "verbosity" : 2 }
{
  "id"             : 128,
  "author"         : { "id" : 3, "name" : "Author Authorous" },
  "state_id"       : 3,
  "section_id"     : null,
  "section_part"   : null,
  "issue_id"       : 18,
  "titles"         : [
                      { "language_id" : 1, 
                        "name"        : "Title of article",   
                        "id"          : 18,
                      }, 
                      { "language_id" : 2,
                        "name"        : "Title of article 2", 
                        "id"          : 23 },
                     ],
  "contents"       : [
                      { "language_id"     : 1,
                        "id"              : 512,
                        "revision"        : 12,
                        "revision_author" : {"id" : 13, "name" : "Somebody"},
                        "revision_time"   : 123152,
                        "content"         : "really long long content\n...",
                      }, 
                      { "language_id"     : 2,
                        "id"              : 513,
                        "revision"        : 2,
                        "revision_author" : {"id" : 13, "name" : "Nobody"},
                        "revision_time"   : 123172,
                        "content"         : "really long long content 2\n...",
                      },
                     ],
}
Clone this wiki locally