diff --git a/htdocs/application/controllers/api.php b/htdocs/application/controllers/api.php index 3ecee9a..47b8e5e 100755 --- a/htdocs/application/controllers/api.php +++ b/htdocs/application/controllers/api.php @@ -33,9 +33,7 @@ class Api extends Main if (!$this->input->post('text')) { - $data['data'] = array( - 'error' => 'missing paste text', - ); + $data['msg'] = 'Error: Missing paste text'; $this->load->view('view/api', $data); } else @@ -47,9 +45,7 @@ class Api extends Main } $_POST['code'] = $this->input->post('text'); $paste_url = $this->pastes->createPaste(); - $data['data'] = array( - 'url' => base_url() . $paste_url, - ); + $data['msg'] = base_url() . $paste_url; $this->load->view('view/api', $data); } } diff --git a/htdocs/application/views/api_help.php b/htdocs/application/views/api_help.php index c91fae3..43982c8 100755 --- a/htdocs/application/views/api_help.php +++ b/htdocs/application/views/api_help.php @@ -9,8 +9,8 @@

Return values

- On success, the API returns the paste URL in JSON format: {"url":""}
- On error, the API returns the error message in JSON format: {"error":"missing paste text"} + On success, the API returns the paste URL:
+ On error, the API returns the error message: Error: Missing paste text

POST parameters

diff --git a/htdocs/application/views/view/api.php b/htdocs/application/views/view/api.php index 07689db..1a7ef07 100755 --- a/htdocs/application/views/view/api.php +++ b/htdocs/application/views/view/api.php @@ -1,3 +1,3 @@