• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
REST Server Returns 403-Forbidden Error

#1
Hi. I have installed a RESTful Server using https://github.com/chriskacerguis/codeig...restserver. I installed it using Composer and created a controller. When I test it using POSTMAN, I am getting 404 - Forbidden error message. What am I doing wrong.

Here is the controller.

PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

use 
Restserver\Libraries\REST_Controller;
require(
APPPATH 'libraries/REST_Controller.php');

class 
Webapi extends REST_Controller
{
    
// Define global variables
    
var $postData;

    
/**    
    * @desc Class constructor
    * @author Allie Syadiqin
    * @access public
    * @param void
    * @return NULL
    */
    
function __construct()
    {
        
// Construct the parent class
        
parent::__construct();

        
// Load libraries
        
$this->load->library('template/acd_api_lib');

        
// Load models
        
$this->load->model('template/acd_api_model');

        
// Set XSS filtering
        
$this->postData    $this->input->post(nulltrue);

        
// Define current time with local timezone
        
$currentDateObj            = new DateTime("now", new DateTimeZone('Australia/Brisbane') );
        
$this->currentDateTime    $currentDateObj->format('Y-m-d H:i:s');
    }
    
// End class constructor

    /**
     * @desc Endpoint to authenticate user
     * @author Allie Syadiqin
     * @access public
     * @param void
     * @return REST_Controller response
     */
    
public function authenticate_post()
    {
        
// Define variables
        
$apiKey        $this->postData['apiKey'];
        
$providerId    $this->postData['providerId'];

        
printr($this->postData);
    }
    
// End method authenticate_post()
}
// End class Webapi 
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme ¬© 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.