Coder Social home page Coder Social logo

manuelgil / rest-api-with-slim-php Goto Github PK

View Code? Open in Web Editor NEW
74.0 11.0 38.0 1014 KB

REST API with PHP Slim Framework 3 and MySQL

License: MIT License

PHP 65.91% TSQL 34.09%
rest restful rest-api restful-api slim slim-3 slim-framework slimphp slim-micro-framework restapi

rest-api-with-slim-php's Issues

Update doc with 'login' and 'register' api example to get clear idea

Hi,

First of all thank you for creating this clean starter project. I was experimenting with it, I installed and setup as per the instruction.

Currently when I hit an api lets say GET to http://localhost/REST-api-with-slim-PHP/public/webresources/mobile_app/ping

It send me response back pong which is correct.

But could you provide me example for LOGIN and REGISTER ?

I assume that for LOGIN it would be http://localhost/REST-api-with-slim-PHP/public/webresources/mobile_app/login/testUser/testPwd (without Bearer token)

I am getting blank response for above hit. Could you suggest me where I am doing wrong?

Installing in the correct folder ?

I have followed you advice given that is composer require slim/slim "^3.0"
Now when I go it create a folder called vendor and in it is slim with many slims folder like this /var/www/html/vendor/slim/slim/Slim so where to copy your codes ? Please advice ?

Slim 4 upgrade inquiry.

Hi
How is it going?
Any thoughts on updating to slim 4?
So, I hope you are always healthy and happy.

Cannot GET lists

Hi and thanks for the starter API.

I was able to register a new user and log in. I'm trying to GET lists but it's returning a 500 error. Here's the RAW response. Can you have a look?

Thanks!

HTTP GET http://domain/webresources/mobile_app/list/
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJoZWFkZXIiOnsiaWQiOiIzIiwidXNlciI6InRlc3RfdXNlciJ9LCJwYXlsb2FkIjp7ImlhdCI6IjIwMTgtMDQtMDYgMDE6NDY6MTkiLCJleHAiOiIyMDE4LTA0LTA2IDAzOjQ2OjE5In19.Wi31CNlssEg7bv0xAqJ7KMYUcONbGc-lbnBHb4VKKMQ
Host: domain


500 Internal Server Error
date: Fri, 06 Apr 2018 01:46:34 GMT
server: Apache/2.4.29 (Unix) PHP/7.1.14
connection: close
x-powered-by: PHP/7.1.14
content-length: 445
content-type: text/html;charset=UTF-8
<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'><title>Slim Application Error</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{display:inline-block;width:65px;}</style></head><body><h1>Slim Application Error</h1><p>A website error has occurred. Sorry for the temporary inconvenience.</p></body></html>

The value is incorrect in postman.

Hi.
When I run http: // localhost / public / webresources / mobile_app / verify, the result of "200 OK" is displayed in RestEasy.
However, when running in postman, the status is "401 Unauthorized".
What did I do wrong in postman?
please answer about my question.
Thank you :)

GET: http: // localhost / public / webResources / mobile_app / verify
Authorization
TYPE: BearerToken
Token: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJoZWFkZXIiOnsiaWQiOjEsInVzZXIiOiJ0ZXN0VXNlciJ9LCJwYXlsb2FkIjp7ImlhdCI6IjIwMTktMDEtMDEgMDA6MDA6MDAiLCJleHAiOiIyMDIwLTAxLTAxIDAwOjAwOjAwIn19.RTTPlUqE - WMP9M28-oj7p8MhWdisuuhWBsioDa_bgY

Keep getting 401 unauthorized

Hi Manuel thanks for this API,
i succeded in installing and making calls but I keep getting a 401 error when I try methods that need the autentication token. Here's the screen...

issue_401

I enabled displayErrorDetails in the index, how can I debug this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.