How to run Facebook's curl codes? - facebook

Im new to php n curl.. Im going to use Facebook's OGP for my facebook app that im using in my website..I created OPG setings for publish my app activities to the users profile.
https://developers.facebook.com/docs/beta/opengraph/tutorial/
After i have setup accouring to the Tutorial(above url) they give me curl code like
curl -F 'access_token=AAACAwq1JHZA0BAA94uB50n7O71B6PmMUsFAydKBKCv1HcdJw9NwK8MZC83vL2YqUXojQ0aXH8EBjTweKHQTr4bZBKlgkOJ0nB5dBDu6A09UbI0lmXZBs' \
-F 'friend=http://samples.ogp.me/205849716166552' \
'https://graph.facebook.com/me/yalumalu:add'
and
curl 'https://graph.facebook.com/me/yalumalu:add?access_token=AAACAwq1JHZA0BAA94uB50n7O71B6PmMUsFAydKBKCv1HcdJw9NwK8MZC83vL2YqUXojQ0aXH8EBjTweKHQTr4bZBKlgkOJ0nB5dBDu6A09UbI0lmXZBs'
I don't know how to run these codes in my site..Tutorial says something else there no curl codes in tutorial that given by facebook.. I tried alot.. Someone please help me to do this..

cURL is a simple way to HTTP GET/POST/DELETE requests.
If you need to achieve similar behaviour in your site you need to choose a language that supports sending these requests.
For example you can use PHP and cURL options as well as the PHP SDK or you can use JavaScript to do the same with the JS SDK

Related

drf social-oauth2 access_denied ,Your credentials aren't allowed

I'm trying to use this package https://github.com/RealmTeam/django-rest-framework-social-oauth2
In Google Example
When I try to request an access_token by
curl -X POST -d "grant_type=convert_token&client_id=<django-oauth-generated-client_id>&client_secret=<django-oauth-generated-client_secret>&backend=google-oauth2&token=<google_token>" http://localhost:8000/auth/convert-token
it's saying
{"error":"access_denied","error_description":"Your credentials aren't allowed"}
What should I put in
django-oauth-generated-client_id and django-oauth-generated-client_secret
is that the thing where you create new application or should I put the google's client and secret ids
I try both but still not working.
Also in
token=<google_token>
I try to put the Authorization code or the access_token in this image but still not working
enter image description here
Can someone help thank you

How can i get the logs of git using github API

I referred to many documents to get the logs of GitHub using GitHub API. But I couldn't find the way. I want to get the logs of GitHub events(commit, changes, etc..) and send them to cloudwatch. How can I achieve this? Or any other way to get the log without using authentication?
For example, I need a command like this so that I can get the logs without touching GitHub
curl -i -H "Authorization: token <PAT token>." \
https://api.github.com/user/repos
or any program to get the logs is welcome
or Any rest API to get the GitHub logs
I am not familiar with GitHub. can anyone give me a solution or idea?
below I mentioned the links that I have followed. Anyone can refer and if possible modify any command or API call to get the logs it would be great.
https://www.softwaretestinghelp.com/github-rest-api-tutorial/
https://dev.to/gr2m/github-api-authentication-personal-access-tokens-53kd
https://titanwolf.org/Network/Articles/Article?AID=f441bab7-8fc8-45ae-b12b-4c41efbbe2d1

unable to call REST API from browser

My REST API with basic authentication works fine using Rest client (Google Chrome extn).
The same also working fine with below Curl command:
curl --header "Accept:application/json" -i --user user1:user1Pass http://localhost:8080/authenticate
But when testing the same in browser I'm getting 404 not found error. The browser URL: http://user1.user1Pass#localhost:8080/authenticate
Can anyone please help me on this?
You're using a period instead of a colon.
The format of the url should be http://user1: user1Pass#localhost:8080/authenticate
The main point is you need to separate username and password by colon.

Is it possible to share Facebook Test users between test apps?

We have seperate URLs for our webapp on local development and on build servers (acceptance test environment) This means that we have to setup 2 seperate Test Apps for Local and Acceptance Test.
When creating test users it seems they can only be created to be valid on only 1 test app... and I have not been able to find a way to share test users between test apps. Not being able to do this makes automated acceptanse testing a pain... as we have to have seperate testdata for Local testing and acceptance testing.
Would love to hear any suggestions on how to solve this easily?
Simple example with curl (its not possible to do it from the Dashboard)
Copy
curl -i -X GET \
"https://graph.facebook.com/v2.9/SOURCE_APP_ID/accounts/test-users?access_token=SOURCE_APP_ACCESS_TOKEN"
Paste
curl -i -X POST \
-d "uid=TEST_USER_ID" \
-d "owner_access_token=SOURCE_APP_ACCESS_TOKEN" \
-d "access_token=TARGET_APP_ACCESS_TOKEN" \
"https://graph.facebook.com/v2.9/TARGET_APP_ID/accounts/test-users"
Afaik you can only create test users for one App, but you can also create them with the API as it is explained in the Facebook docs: https://developers.facebook.com/docs/apps/test-users
Direct link to example code: https://developers.facebook.com/docs/graph-api/reference/v2.2/app/accounts/test-users
Create a test user and then use the API to connect the user to the second app.

CURL should be enable for facebook application?

I am new to facebook application development.
I try to create facebook as per following url.
http://net.tutsplus.com/tutorials/javascript-ajax/design-and-code-an-integrated-facebook-app/
But I am getting following error.
I have hosted application on shared web hosting and do we need to have CURL enable to
facebook application.
I have CURL disabled on shared web hosting.
Error
Sorry, the application you were using is experiencing a problem. Please try again later.
I try to check from my local XAMPP and got CURL error and after I enable CURL error solve.
Thanks
Here's an article on how to get CURL enabled on PHP servers:
http://www.wallpaperama.com/forums/how-to-find-out-if-php-is-compiled-with-curl-extension-installed-enabled-t1576.html