Can we use multiple scopes in Google People API in PHP - google-people-api

I am using google people API in php.
Please answer this question.
i am very confused.
Basically i want to display email address, if anybody have solution suggest me
$client = new Google_Client();
$client->setApplicationName('People API');
$client->setScopes(Google_Service_PeopleService::CONTACTS);
$client->setAuthConfig('credentials.json');
$client->setAccessType('offline');
$client->setPrompt('select_account consent');

setScopes supports an array of scopes.
$client->setScopes([
Google_Service_PeopleService::CONTACTS,
Google_Service_PeopleService::USER_EMAILS_READ
]);

Related

How to use AWS amplify API in postman?

I have to use below inbuild functions of APIs but how can I use that function to create dynamic sub domain?
It meant, what will be host name for that? and how can I pass request object?
POST /apps/appId/domains HTTP/1.1
what will be the Request URI for that?
https://docs.aws.amazon.com/amplify/latest/APIReference/API_CreateDomainAssociation.html
If anyone have knowledge about it and then please help me.
Thanks in advance

App Engine App failing with File(/base/data/home/.config/gcloud/application_default_credentials.json) is not within the allowed path(s)

My Google App Engine based website started failing suddenly with following error -
file_exists(): open_basedir restriction in effect. File(/base/data/home/.config/gcloud/application_default_credentials.json) is not within the allowed path(s):
Any help/pointers will be appreciated as my website is currently down because of it.
I post here another possible solution as I had exaclty the same error message, even the reason was different. This is why this question came up while I searched for it.
I am using the Google Translation API:
https://googleapis.github.io/google-cloud-php/#/docs/google-cloud/v0.153.0/translate/v2/translateclient
In my case I didn't provide in $translate = new TranslateClient(); the parameter key.
Providing the Google API key $translate = new TranslateClient([ "key" => "my-key" ]); fixed it.

How to use cognito:username at http proxy integration of HttpApi of AWS?

I want to use the variable named event.requestContext.authorizer.jwt.claims.cognito:username which is the result of JWT authorizer at the URI of http proxy integration of HttpApi(I mean not RestApi) of AWS , because I want to access the information of authorized user. The exposed api is like this.
https://xxxxxx.com/platform/pro/user/john
pro means production .
john is event.requestContext.authorizer.jwt.claims.cognito:username .
The management console said my input like this is error.
https://xxxxxx.com/platform/${stageVariables.stage}/user/${event.requestContext.authorizer.jwt.claims.cognito:username}
I think : is NG.
Please help me.
I just found this question by accident. I guess you solved this in the meantime, but in case it's still relevant, you need to put cognito:username in quotes and brackets, so instead of ${event.requestContext.authorizer.jwt.claims.cognito:username} use ${event.requestContext.authorizer.jwt.claims['cognito:username']}.

From Classic ASP consume a ssl .net web service

I've researched the web extensively before posting this questions here, couldn't find anything usefull for me, so here it goes. Sorry in advance for the wall of text.
I have a classic ASP website that needs to call a web service method (not wcf, but an asmx page) on a asp.net website (4.0)
The way I consume the web service is as follows:
I have a webserviceclass.asp that helps me consume web services in classic asp.
code of webserviceclass.asp -> https://docs.google.com/file/d/0B1Wr1Kw74xy3ZkducEtiTWNtWDA/edit?usp=sharing
Then calling the class to consume the method.
Dim strWebServiceResult
Dim ws
Set ws = new webservice
ws.url = "http://www.myurl.com/mywebservice.asmx"
ws.method = "HelloWorld"
ws.parameters.Add "Parameter1", "Test1"
ws.parameters.Add "Parameter2", "Test2"
ws.Execute
strWebServiceResult = ws.response
This works perfectly if www.myurl.com is not encrypted, strWebServiceResult holds the XML returned by mywebservice.asmx, however I really need the data traveling between the users and www.myurl.com to be encrypted (mywebservice.asmx has parameters for login and password to authenticate on the webservice) so I bought an SSL cert and assigned it to www.myurl.com website becoming https://www.myurl.com
So when I set the URL in the class to: ws.url = "https://www.myurl.com/mywebservice.asmx"
and that is the only thing that changes, the method doesn't get called anymore. I have log on pageinit and pageload of the mywebservice.aspx and it doesn't even get called.
Sorry about the long text, and I hope someone can help me. I have no experience with jquery or json and I'd rather not go that way to solve this problem, but if that's the only way, I can try if there's enough info out there to help me out but I'd rather try to fix my current code if that possible. I just don't understand why it works with http but not with https
Many thanks in advance
In this SO question ("Can't use HTTPS with ServerXMLHTTP object"), this issue was addressed.
For a starter, you should be using "MSXML2.ServerXMLHTTP" instead of "Microsoft.XMLHTTP" on the server side. This is discussed here, f.i.: differences between Msxml2.ServerXMLHTTP and WinHttp.WinHttpRequest?

Difference between api call '/me' and '/<fbid>'

As the title says, what is the difference when doing a request with the php sdk, between api('/me') and api('/current_user_fbid')?
Adding to avs099's answer.
You cannot use me without an access token. But you can use an id without access token.
e.g.
http://graph.facebook.com/1137725463 works, but
http://graph.facebook.com/me will fail
as #Dhiraj Bodicherla said, "me" and "current_user_id" are the same - but there are exceptions when you cannot use "me" - for example, when you do requests using application or page tokens. So if you are writing a backend code which is dealing with multiple users/tokens etc - keep this in mind - you can't use "me" with app token.
Using me or current_user_id in graph api will yield the same result.
You should check Developer Tool Explorer
DEMO
Hope this helps