Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get posts with this api? #14

Open
sarinsurendran opened this issue Jul 6, 2016 · 7 comments
Open

how to get posts with this api? #14

sarinsurendran opened this issue Jul 6, 2016 · 7 comments
Labels

Comments

@sarinsurendran
Copy link

http://localhost/api-template1/rest/web/v1/posts

shows http://prntscr.com/bpfq9v

@githubjeka
Copy link
Owner

githubjeka commented Jul 8, 2016

#9 (comment)
#11

@githubjeka
Copy link
Owner

And #6 (comment)

@sarinsurendran
Copy link
Author

This is the login api right.. I need how to get posts with authorisation. It shows unauthorized.

@githubjeka
Copy link
Owner

See https://github.com/githubjeka/yii2-rest/blob/master/rest/versions/v1/controllers/PostController.php#L16-L18

You should send an access token for every request. The token is response from login (see the response #6 (comment))

Read more about authentication in http://www.yiiframework.com/doc-2.0/guide-rest-authentication.html (Query parameter)

@sarinsurendran
Copy link
Author

Ok. If that is the case we have to pass only the token with request right. No need of passing username and password. Can you just send me the screen shot for posts request to clear the idea.

@githubjeka
Copy link
Owner

Yes

Get token:

image

Get posts:

image

@sarinsurendran
Copy link
Author

Ok thanks for your comments githubjeka.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants