I am working on a project and I don't know how to use API using token.
I have token but
Site URL:- https://example.com/api This info is given on site:
To identify yourself you should include the following data on the beginning of your requests (header):
Header = Authorization Value = Token token=YOUR ACCESS TOKEN
How do I receive and send data from API using PHP?
You can use cURL:
$crl = curl_init("https://example.com/api");
$header = array();
$header[] = 'Authorization: Value=Token token=<YOUR_ACCESS_TOKEN>';
curl_setopt($crl, CURLOPT_HTTPHEADER,$header);
$rest = curl_exec($crl);
curl_close($crl);
print_r($rest);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With