Questions tagged [yii2-api]

Yii provides a whole set of tools to simplify the task of implementing RESTful Web Service APIs.Quick prototyping, Response format, data caching and HTTP caching, rate limiting and a lot more. This tag should be used for all Yii2 REST Services based questions.

22 questions
0
votes
0 answers

Angular 7 http.post is sending null to yii2 API

I am trying to submit data from angular to Yii2 This is my service in angular where I am trying to send data through POST import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders } from '@angular/common/http' …
rji rji
  • 697
  • 3
  • 17
  • 37
0
votes
1 answer

Yii2-Api: How to pass Token for the HttpBearer Filter

Here is my Controller class ClientController extends ActiveController { public $modelClass = 'common\models\Client'; public $serializer = [ 'class' => 'yii\rest\Serializer', 'collectionEnvelope' => 'items', ]; public…
rajwa766
  • 604
  • 13
  • 31
0
votes
2 answers

Yii2 - API Rest - ActiveDataProvider

I am building a REST API using Yii2 Basic Template. I am getting an error: exception 'yii\base\InvalidArgumentException' with message 'Response content must be a string or an object implementing __toString().' in…
Eduardo
  • 1,781
  • 3
  • 26
  • 61
0
votes
2 answers

How to return data in descending order in YII2 ActiveController?

How to return data in descending order in YII2 ActiveController? Please help me. The JSON response returned from activecontroller must be in descending order by news_id.
Rabindra Acharya
  • 1,868
  • 2
  • 18
  • 32
0
votes
2 answers

rewrite POST method on rest api yii2

I must rewrite post request on rest yii2. Every time i've post request on url v1/availability I want to call actionCreate for manage request. This is my main.php 'urlManager' => [ 'enablePrettyUrl' => true, …
Andrea Perdicchia
  • 2,786
  • 1
  • 20
  • 19
0
votes
1 answer

Yii2 Rest Api User bearer Authentication expiration time

i am currently working on a yii2 based Rest api. i use bearer token for user authentication.let me explain the requirement. 1)first user authenticated from a external php application using their credentials. 2)he/she got an access Token. 3)each…
user4206843
-1
votes
1 answer

What is the best approach to implement multi language app using angular and yii2

I'm using yii2 restful api for the backend, and angular for the frontend. I want to ask about the best approach to implement multi-language feature that can manages both frontend an backend in the same place (db table, file).
1
2