I am trying to test the REST API module in my Yii2 system and having some trouble with a simple Get Request. I’ve done a lot of variations of this call, but always get back:
public function userIsAuthenticated(\ApiTester $I)
{
$I->amGoingTo('Attempt to see if Im authenticated');
$I->amHttpAuthenticated('my_access_token', '');
$I->sendGET(Url::toRoute('/api/orders'), ['id' => 4]);
$I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); // 200
}
If I echo out the Url::toRoute and put it’s output into the web browser, it asks me for my auth token. So I’m fairly confident the path is good.