Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

How do I create a authentication key ?

$
0
0
Im trying to work with a Companies API Program - I have never done any coding or used PHP before - Im currently stuck at how do I create the authentication code 

What program should I use ? How do i do it ? - I have all the info it requests Secret key, account id and image id but I have no ideal what to do with it. 

Im currently stuck and really need help with this. 

Below is exactly what is listed on there site - Thanks in Advance 

  Purchase

Once you have funded your API account you will be able to download full resolution un-watermarked images. Purchasing images requires an authentication key to be passed with each request. The authentication key is generated using the secret key provided and is a combination of the secret key, your account ID and the image ID the user is purchasing. The authentication key is the SHA-1 hash (40 character hexadecimal) of those three data elements.

// Example PHP code to generate auth_key for purchase request
$auth_key = sha1($secret_key . $account_id . $image_id);

The auth_key that is generated needs to be passed with the purchase request. To purchase an image, include the image ID, Size Code and the authentication key.

api.bigstockphoto.com/2/[account id]/purchase?image_id=[image id]&size_code=[size code]&auth_key=[auth_key]


If the purchase is approved, a download ID will be returned which can then be used to download the image file.

{"response_code":200,
"message":"success",
"data":{
"currency_amount":2.99,
"currency_code":"USD",
"download_id":724111049}
}

 

Viewing all articles
Browse latest Browse all 13200

Trending Articles