I’m using the Foursquare API and I need to make a request to their server in order to receive an access token in JSON form (https://developer.foursquare.com/overview/auth). How do I do this using PHP?
I haven’t found any definitive tutorials online, which is why I’m asking here. I’ve seen some stuff to do with cURL which I don’t really understand, so is there any easy way to do this? I have done it before using AJAX and it was very self explanatory, but it seems very complicated in PHP, far more than it needs to be by the looks of it 🙁
Can anyone help? Thanks
Well, following the link you provided, try this:
Script in the redirect link(YOUR_REGISTERED_REDIRECT_URI)
NOTE: After reading the tutorial you provided, I didn’t see any reference to POST request, only request, so you can try this (instead of cURL)
If it’s a simple GET request, then file_get_contents will probably work.