Skip to main content

Easier, faster, better looking & still secure – API Tokens

If you’ve ever had to access Panda API by crafting raw HTTP requests or write your own Panda client library, you must know how annoying request signatures could be. They make communication very secure, but can be very inconvenient.

Building a signature was quite a complex, error prone task. And debugging wasn’t the most pleasant thing on earth either as the number of possible mistakes was huge. Each of them manifested in the same way – an error message saying that signatures mismatch has occurred.

Wouldn’t it be great to have another authorization method, whose usage would be as simple as copy & paste a string? Without compromising security. One that would be simple enough to make querying Panda from command line tools actually viable?

It bothered us as well so we decided to put some time into making everyone’s life bit easier. We came up with a solution that’s being used by a number of payment platforms. And these guys usually do care about security. If you’re using Panda API you will now be able to authorize yourself through an API Token instead of a signature.

There is one unique auth token per encoding cloud in Panda. You can check API Token for each cloud in our web application and generate new one if needed.

skpMpbhAQGX4eqctNp0W
API Token view

And now we can finally do what other services have been bragging about for a long time. We can have curl examples. YAY!

That’s how you send a file to Panda now (more examples in our docs):

curl -X POST -H "Content-Type: multipart/form-data" -F "file=@/path/to/file/panda.mp4" "http://api.pandastream.com/v2/videos.json?token=clou_lCTyUrw5eapr3rVE5vTOwlgxW&file=panda"

Response:

{
   "id":"524fb96a85e8cf0edbe5865d070539cc",
   "status":"processing",
   "created_at":"2015/07/17 15:33:47 +0000",
   "updated_at":"2015/07/17 15:33:48 +0000",
   "mime_type":null,
   "original_filename":"panda.mp4",
   "source_url":null,
   "duration":14014,
   "height":240,
   "width":300,
   "extname":".mp4",
   "file_size":805301,
   "video_bitrate":344,
   "audio_bitrate":112,
   "audio_codec":"aac",
   "video_codec":"h264",
   "fps":29.97,
   "audio_channels":2,
   "audio_sample_rate":44100
}

 

That’s all folks. Have a great weekend!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.