I will developing RestFul API with Lumen, but I got some problem.
When I try to get user with email. I got message
"The requested resource /user/test#example.com was not found on this server."
Here my route
$router->get('/{email}', ['as' => 'get', 'uses' => 'UserController#show']);
I try same url in laravel, but It works. I don't know why?
Anyone can suggest or help me, please.
In lumen Routes are like below
$app->get('/user/{email}', 'ThorController#show');
For more information : https://lumen.laravel.com/docs/5.4/routing#route-parameters
Also check your database credentials whether you are using different database for api then laravel application
Related
my project work very well in local server but when i publish it in live hosting everything work except the oauth2 not work and give me Route [login] not defined
i dont khnow were is the problem
my .htaccess
my Route api
Laravel redirect you to login route when API request doesn't authenticated, so add this line to routes/web.php file:
Route::post('login', [ 'as' => 'login', 'uses' => 'LoginController#do']);
Hi I am very new to Angular and programming in general and I have been trying to query the Amadeus low-fare-search with Angular HTTPClient and failing, I have been looking around for answers, but havent found anything specific to this, I have found some answers related to the specific problem of "unable to identify proxy".
And according to some the reason for this is that the URL is incorrect.
But this is the URL on Amadeus page
Resource URL
This is the code i am trying to run :
search(){
return this.http.get('http://api.sandbox.amadeus.com/v1.2/flights/low-fare-search?origin=IST&destination=BOS&departure_date=2018-10-15&return_date=2018-10-21&number_of_results=3&apikey=my API key')
.subscribe((data) =>{
console.log(data)},
(err) => {console.log(err)});
Here is the error message
errorcode: "messaging.adaptors.http.flow.ApplicationNotFound"
faultstring:"Unable to identify proxy for host: default and url:
/v1.2/flights/low-fare-search"
Can someone explain to me in simple terms what could be causing this error?
In your example, you are using http instead of https
I tested your example and it works for me:
https://api.sandbox.amadeus.com/v1.2/flights/low-fare-search?origin=IST&destination=BOS&departure_date=2018-10-15&return_date=2018-10-21&number_of_results=3&apikey={your_api_key}
I setup ruby on rails backend project on gcloud and now when i am trying to fetch data to a WordPress site using wp_remote_get() method from my json API. the
https://gcloud-assigend-domain.com/api/v1/auth/signin
gcloud is returning me 401 authentication,
although the same thing is working fine at my localhost.
Via wp page i am sending user email and password to API so i can get token-access, client-id, uid and expiry to process.
If anyone aware of this please help me.
I forgot to set the header to 'Content-Type' => 'application/x-www-form-urlencoded',
so i just add the header to wp_remote_post() method and fixed the issue.
'headers' => array(
'Content-Type' => 'application/x-www-form-urlencoded',
),
I have a plugin that need some instagram infos of my application.
This plugin just show photo feed.
I have created the application on the instagram developers and get my client id, but, what's the redirect url? I put my website link because i really don't understand what is that.
What i need is:
id: 'MY PROFILE ID',
redirectUrl: 'http://www.kyriosfestival.com.br',
clientId: 'MY CLIENT ID FROM MY APPLICATION',
accessToken: 'GENERATED FROM INTERNET'
And it's not working.
I have used a access token generated from internet, and i don't know if is this the problem.
What is the real form to use that?
Anyone?
Thanks!
Must be late, but will post an answer, so that maybe it will help anyone some day.
For all your Instagram API calls, you need to receive a valid access token.
You can get one by implementing authentication (client-side or server-side), full guide can be found here.
So for example, if you choose to go with client-side authentication,
you should direct a user to authentication URL, which will looks like this:
https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token
After that, user will be redirected to your redirect page (REDIRECT-URI). This REDIRECT-URI should match the URL you have specified in Manage Clients section.
After the redirect happens, you will get the access token in the URL of the page you've been redirected to.
http://your-redirect-uri#access_token=ACCESS-TOKEN
You can then extract your ACCESS-TOKEN from url and start making API calls.
Project which I am currently working is developed using ZF and dojo.
For our Development and Production server we have basic user authentication which is handled using apache's virtual host config file (by having users and password files).
When we type the server URL, it will pop-up the authentication window. It is working well.
We have following controllers in our project.
Index
profile
Error
Signoff
But now our client has come up with a new requirement that only for "Signoff Controller", they would like to allow access to everyone in the network without any authentication.
But if they try to access other controllers it should ask for user authentication.
Kindly let me know your thoughts about solving this issue either by using .htaccess( apache URL rewrite ) or ZF classes if any.
You should probably try to set this up in Zend as it will give you a more flexible setup.
// just a simple example to get you started
$config = array(
'accept_schemes' => 'basic digest',
'realm' => 'My Web Site',
'digest_domains' => '/members_only /my_account',
'nonce_timeout' => 3600,
);
$adapter = new Zend_Auth_Adapter_Http($config);
Check out more on the Zend Manual on different types of auth.