From 7c625e983f4b1c7cca20c4d38de59ffdcbe6f201 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 03 2015 08:02:12 +0000 Subject: Move the api.rst into pagure/doc/api.rst This way we include the API documentation within the sources --- diff --git a/doc/api.rst b/doc/api.rst index 265345d..8edbf23 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -1,64 +1,5 @@ -Pagure API v0 Reference -======================= +Pagure API +========== -Overview --------- - -This documentation describes the Pagure API v0. - -Authentication -~~~~~~~~~~~~~~ - -To access some endpoints, you need login Pagure using API token. You can -generate one in the project setting page. - -When sending HTTP request, include ``Authorization`` field in the header -with value ``token $your-api-token``, where ``$your-api-token`` is the -API token generated in the project setting page. - -Anyone with the token can access the APIs on your behalf, so please be -sure to keep it private and safe. - -Request Encoding -~~~~~~~~~~~~~~~~ - -The payload of POST and GET requests is encoded as -``application/x-www-form-urlencoded``. This is an example URL of a GET -request: -``https://pagure.io/api/0/test/issues?status=Open&tags=Pagure&tags=Enhancement`` - -Return Encoding -~~~~~~~~~~~~~~~ - -The return value of API calls is ``application/json``. This is an -example of return value: - -:: - - { - "args": { - "assignee": null, - "author": null, - "status": null, - "tags": [] - }, - "issues": [ - { - "assignee": null, - "blocks": [], - "comments": [], - "content": "Sample ticket", - "date_created": "1434266418", - "depends": [], - "id": 4, - "private": false, - "status": "Open", - "tags": [], - "title": "This is a sample", - "user": { - "fullname": "Pagure", - "name": "API" - } - } - ] - } +The API documentation can be found at https://pagure.io/api/0/ or within +the sources in ``pagure/doc/api.rst``. diff --git a/pagure/doc/api.rst b/pagure/doc/api.rst new file mode 100644 index 0000000..265345d --- /dev/null +++ b/pagure/doc/api.rst @@ -0,0 +1,64 @@ +Pagure API v0 Reference +======================= + +Overview +-------- + +This documentation describes the Pagure API v0. + +Authentication +~~~~~~~~~~~~~~ + +To access some endpoints, you need login Pagure using API token. You can +generate one in the project setting page. + +When sending HTTP request, include ``Authorization`` field in the header +with value ``token $your-api-token``, where ``$your-api-token`` is the +API token generated in the project setting page. + +Anyone with the token can access the APIs on your behalf, so please be +sure to keep it private and safe. + +Request Encoding +~~~~~~~~~~~~~~~~ + +The payload of POST and GET requests is encoded as +``application/x-www-form-urlencoded``. This is an example URL of a GET +request: +``https://pagure.io/api/0/test/issues?status=Open&tags=Pagure&tags=Enhancement`` + +Return Encoding +~~~~~~~~~~~~~~~ + +The return value of API calls is ``application/json``. This is an +example of return value: + +:: + + { + "args": { + "assignee": null, + "author": null, + "status": null, + "tags": [] + }, + "issues": [ + { + "assignee": null, + "blocks": [], + "comments": [], + "content": "Sample ticket", + "date_created": "1434266418", + "depends": [], + "id": 4, + "private": false, + "status": "Open", + "tags": [], + "title": "This is a sample", + "user": { + "fullname": "Pagure", + "name": "API" + } + } + ] + }