Using PHP to hook into the Eventbrite API
Going to https://www.eventbriteapi.com/v3/users/me/owned_events/?token=XXX&expand=ticket_classes works and ticket_classes is expanded
However when I use https://www.eventbriteapi.com/v3/users/me/owned_events/?token=XXX&expand=ticket_classes,attendees then attendees is not expanded but it shown under EXPANDED FIELDS
Am I doing something obviously wrong?
Thanks
You need to query the /events/{event_id}/attendees/
curl -X GET https://www.eventbriteapi.com/v3/events/{event_id}/attendees/ -H 'Authorization: Bearer PERSONAL_OAUTH_TOKEN'
Read more in the docs: https://www.eventbrite.com/platform/docs/attendees
Related
Sending POST request data stored in a variable using curl, sends $variable instead json data.
P=`/usr/bin/sudo /usr/bin/curl -X POST -H "Content-Type:application/json" --data-urlencode $data http://127.0.0.1/abc.php`
Trying to send POST request to php, but it receives $data instead json data{"abc":"11","xyz":"20"}.
Had try with '$data', "$data", \'$data\' and \"$data\", where $data = {"abc":"11","xyz":"20"}
Please give an example that works. Thanks in advance.
P=`/usr/bin/sudo /usr/bin/curl -X POST -H "Content-Type:application/json" -d "$O" http://127.0.0.1/abc.php` solves issue.
If you add single quote it won't expand variable, so it requires to add double quote.
I suggest all time reload page or script, as I have seen if you not reload, it work with your last change instead new one.
I am using PerfectSwift for a RESTful API to bridge our TeamCity build server and HipChat; however I am stuck at a point whereby I am unable to post to the HipChat backend using Perfect's cURL wrapper.
The command I am trying to mimic is:
curl -d '{"color":"green","message":"My first notification (yey)","notify":false,"message_format":"text"}' -H 'Content-Type: application/json' https://<MY DOMAIN>/v2/room/509/notification?auth_token=<MY AUTH TOKEN>
I currently have the following code in my Perfect program:
let curl = CURL(url: "https://<MY DOMAIN>/v2/room/509/notification?auth_token=<MY AUTH TOKEN>")
curl.setOption(CURLOPT_POST, int: 1)
curl.setOption(CURLOPT_POSTFIELDS, s: "{\"color\":\"green\",\"message\":\"My first notification (yey)\",\"notify\":false,\"message_format\":\"text\"}")
curl.setOption(CURLOPT_HTTPHEADER, s: "[Content-Type:application/json]")
curl.perform { (code, header, body) in
}
However, the message never gets to HipChat, or, if it does, it's not in a readable format.
When I paste the first command into terminal, everything works as expected.
From my understanding, this uses a similar system to PHP, and I am therefore including the PHP tag as I feel PHP developers may be able to offer advice if I am using the wrong CURLOPTs etc...
Thanks in advance.
i'm having a hard time authorizing a user login since i just dont know the right syntax. I want to modify https://github.com/ZWEISCHNEIDER/fastbill to enable said login API-wise.
The current header bit looks like this and works
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'header' => 'Authorization: Basic ' . base64_encode($this->email.':'.$this->apiKey)
)
);
With this i can connect to the general API and get all the information. In the documentation of the API it requires me to put the following additional info into the header (left -u line there for better understanding) in order to receive user-bound information only.
-u {E-Mail-Address}:{API-Key} \
-H 'X-Username: {User-Emailaddress}'\
-H 'X-Password: {User-Password}' \
How do i adapt the 'header' content-string to fit X-Username:$username and X-Password:$pwd in there?
(api doc: https://www.fastbill.com/api/fastbill/en/fundamentals.html#authentification)
thanks in advance
ok i'm sorry, this did not have anything to do with malformed header requests from my side -- the api simply won't let me access like i planned using a regular api key
I want to set a header for getting the token from flipkart. I dont know how to set a header in curl. My header should like
curl -u <appid>:<app-secret> https://sandbox-api.flipkart.net/oauth-service/oauth/token\?grant_type\=client_credentials\&scope=Seller_Api
It looks like you're trying to do HTTP basic authentication, or at least that's what the -u option of curl does when used alone like this.
In PHP you would set up basic authentication for a curl request like this, assuming $ch is your curl instance (which you can get with curl_init):
curl_setopt($ch, CURLOPT_USERPWD, 'appid:appsecret');
See the curl documentation on curl_setopt for more information.
In curl command you have to do like this,
curl -u your-app-id:your-app-token https://sandbox-api.flipkart.net/oauth-service/oauth/token\?grant_type\=client_credentials\&scope=Seller_Api
you will get the result like this on success,
{"access_token":"394b7d-418a-43f6-8fd5-e67aea2c4b","token_type":"bearer","expires_in":4657653,"scope":"Seller_Api"}
by using this token you can make further api call's like for example listing api,
curl -H "Authorization:Bearer your-access-token" -H "Content-Type: application/json" -d 'json-here-see-format-in-api-example' https://url-end-point-refer-api-docs
note: you have to create app id and secret in "https://sandbox-api.flipkart.net/oauth-register/login" for sandbox. Don't store the access token it will get expired in certain period of time.
link for api doc's - "https://seller.flipkart.com/api-docs/fmsapi_index.html"
Can I verify any arbitrary PayPal payment-ID from my server?
As stated here: https://developer.paypal.com/webapps/developer/docs/integration/mobile/verify-mobile-payment/ in Looking up a payment using the REST API section, I should send a request looking like this:
curl
https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI
\
-H "Content-Type: application/json" \
-H "Authorization: Bearer
{accessToken}"
What if i pass instead of PAY-5YK922393D847794YKER7MUI any other correct payment-id, which does not belong to me (I am neither a payer, nor a receiver)?
PayPal will not surrender information about payments to callers who are not a party to the payment (and who don't have permission to act on behalf of one of those parties).