This is related to PayPal's API to get user information in sandbox environment as described here - https://developer.paypal.com/docs/api/#get-user-information
curl -sk https://api.sandbox.paypal.com/v1/identity/openidconnect/userinfo/?schema=openid \
-H "Content-Type:application/json" \
-H "Authorization: Bearer <valid_access_token>"
I get a user_id in the json response, but rest of the other user attributes such as name, given_name, family_name are removed. Like so
{
"user_id": "https://www.paypal.com/webapps/auth/identity/user/eyeTNlAeNRNDMpHBW6OCUyA-d7hsvZjChNONOiujnhU"
}
How can I get rest of those attributes?
If you want to get these information, you need to select these attributes in your REST APP on developer.paypal.com site.
Related
I need to replicate data from local database master (using MySQL 5.6) to Google Cloud SQL slave. I read the google instructions and I did it until now:
Installed MySQL 5.6 on local machine and created local instance, database and tables;
Set up to use binary files (it´s necessary for replication);
Created user "replica" to have access to master;
Created backup.sql file using mysqldump and I followed google instructions;
Upload this file to Google storage bucket;
Created 1º generation instance in google Cloud SQL;
Created database into 1º generation instance;
Restored backup.sql into database;
Next steps in google instruction is type the code into Google Shell "ACCESS_TOKEN="...
ACCESS_TOKEN="$(gcloud auth application-default print-access-token)"
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header 'Content-Type: application/json' \
--data '{"name": "[INTERNAL_MASTER_INSTANCE_NAME]",
"region": "[REGION_NAME]",
"databaseVersion": "[EXTERNAL_MASTER_DATABASE_VERSION]",
"onPremisesConfiguration": {"hostPort": "[IP_ADDRESS:PORT]"}}' \
-X POST \
https://www.googleapis.com/sql/v1beta4/projects/[PROJECT-ID]/instances
But I have a error message "400 - Invalid value for: 5.6.39 is not a valid value". Where can I find "databaseVersion": "[EXTERNAL_MASTER_DATABASE_VERSION]" in MySQL? Someone has step-by-step to configure local database using MySQL to replicate data to Google Cloud SQL?
Based on the Configuring External Masters documenation, you have 2 options for the databaseVersion:
For databaseVersion, provide the MySQL version of the master instance:
MYSQL_5_5 or MYSQL_5_6
Since you are inserting 5.6.39 instead, it's triggering the 400 error.
sample request : curl -H "Snapdeal-Affiliate-Id:aaaaa" -H "Snapdeal-Token-Id:bbbbb" "affiliate-feeds.snapdeal.com/feed/api/category/v1:586:1461823?expiresAt=1441751400001&signature=cvtwgjgrrbozmumlaalg" -H "Accept:application/xml"
We can do this by importing this curl format in postman client. It then gives us the sample request ,its headers and body. which makes it quite easire for us to respond to curl request.
I am trying to set up a integration with a REST API, that requires a Base64 encoded key to authenticate, and I cannot seem to get it to work.
The API only returns:
<Code>-4</Code><Message>Not Authenticated</Message>
"Please provide a valid username and password"
My request looks like this:
curl -i
-H 'application/json'
-X GET
-H 'basic :Base64EncodedKey'
http://se.api.anpdm.com/v1/filter/all
No username should be supplied, thats why I use : before the key.
Can someone please try to help me? I am not a developer, I am just in charge of generating code examples.
/Max
A little trick of generate your base64 encode:
echo -n admin:123456 | base64
YWRtaW46MTIzNDU2
Then use it like this:
curl -H "Authorization: Basic YWRtaW46MTIzNDU2" http://nexus.xxxxcloud.com/nexus/service/local/artifact/maven/content
The header is Authorization: Basic Base64EncodedKey. You are missing the Authorization portion in your header.
-H 'Authorization: Basic Base64EncodedKey'
Is there any way to make commands to neo4j from the command line without entering the shell, in other words the equivalent of:
mysql -u user -ppassword -e "INSERT INTO something VALUES something-else"
I'd also like to be able to make commands from an executable script, something akin to:
mysql -u user -ppassword << EOF
INSERT INTO something VALUES something-else;
EOF
Does anyone know the best way to do this?
You could always use curl to post requests to the REST API.
curl --header "Content-Type: application/json" \
--request POST \
--data '{"statements" : [ { "statement" : "create (n:Node {name: \"Test\"} ) return n" } ] }' \
http://localhost:7474/db/data/transaction/commit
Here is the Neo4j REST API reference.
You can pass arguments to the neo4j-shell command :
Execute cypher passed in the command :
./bin/neo4j-shell -c 'match(n:Page) RETURN count(n);'
Or execute a cypher script file :
./bin/neo4j-shell --file your-file.cql
I am working on using box apis to create enterprise user and group. I am unable to create the user/group through curl or through java code as the request results in Forbidden error (403). Please note that the auth token has been created using enterprise admin credentials which could create the user/group in Box admin console.
Following is the curl command and its response :-
curl --insecure https://api.box.com/2.0/groups -H "Authorization: Bearer AUTH-TOKEN" -H "Content-type: application/json" -d "{"\"name"\": "\"family"\"}" -X POST -v
RESPONSE :-
> POST /2.0/groups HTTP/1.1
> User-Agent: curl/7.27.0
> Host: api.box.com
> Accept: */*
> Authorization: Bearer <AUTH-TOKEN>
> Content-Length: 18
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 18 out of 18 bytes
< HTTP/1.1 403 Forbidden
< S erver: nginx
< Date: Fri, 13 Dec 2013 13:04:52 GMT
< Content-Length: 0
< Connection: keep-alive
< WWW-Authenticate: Bearer realm="Service", error="insufficient_scope", error_description="**The request requires higher privileges than provided by the access token."**
Thanks,
Alevi
To call APIs that manage users you have to meet several permissions requirements.
1) The app you build has to have "Manage an Enterprise" scope (Set this up in your application management console in the "OAuth2 parameters"
2) The user logging into your app has to have co-admin permissions
3) The co-admin has to specifically be allowed to "manage users"
Unless you meet all those criteria, you won't be able to call the API to add a user.
If you do, it should be a simple POST to ./users with a json payload with the user object. See http://developers.box.com/docs/#users-create-an-enterprise-user for an example CURL call
I think you may just have the wrong slash.
Try this:
curl https://api.box.com/2.0/groups -H "Authorization: Bearer ACCESS_TOKEN" -d "{\"name\”: \“my group\”}" -X POST