-
May 8th, 2012, 01:14 PM
#1
Thread Starter
Lively Member
Mediafire API help
I'm trying to use mediafire's new REST API, but I can't get the signature for the session_key right.
Here's their wiki: http://developers.mediafire.com/index.php/REST_API
According to them, this format should work:
Code:
email + password + application_id + API Key
But it doesn't. So I tried removing the spaces between the pluses, didn't work. Also tried removing the pluses too, didn't work. Anyone that's familiar with hashing stuff like this that maybe know what they mean?
EDIT: yeah I also asked their support about it, the first answer I got was to check their wiki (even though I wrote that the format on their wiki didn't work). The second answer I got was the format, copied from the wiki, with no example nor any clarification. Now I am waiting for the third answer....
-
May 8th, 2012, 04:05 PM
#2
Re: Mediafire API help
I'd suspect that they are telling you to concatenate those 4 strings (UTF-8 encoded) together, then calculate the SHA1 hash, then convert that to hex digits. Those "+" signs are probably concatentation because these kinds of people tend to be very JavaScript-centric in their thinking.
They don't mention hex but they don't mention base64 either. The worthless "examples" just show a string of decimal digits and that seems entirely unlikely.
Last edited by dilettante; May 8th, 2012 at 04:08 PM.
-
May 9th, 2012, 04:40 PM
#3
Thread Starter
Lively Member
Re: Mediafire API help
Indeed, worthless example. The signature in their example isn't even real I think, they just put together some numbers. I'll try with hex.
-
May 9th, 2012, 09:20 PM
#4
Re: Mediafire API help
I agree with dilettante's suspicion, although I would suggest that the last step is unnecessary because the SHA1 function doesn't produce characters which require URL encoding.
Why they bother with such a stupid parameter is another question.
-
May 12th, 2012, 06:25 AM
#5
Thread Starter
Lively Member
Re: Mediafire API help
I tried hex encoding it, didn't work. Tried base64, didn't work.
I've finally gotten an answer from their support that their dev team is going to take a look at my question...sigh. Hopefully they will give me a correct answer asap.
Worthless documentation is worthless...
-
May 14th, 2012, 03:44 PM
#6
New Member
Re: Mediafire API help
Hi. I am the Lead Web Developer at MediaFire and the MediaFire API engineer.
The signature is a sha1 of the 4 elements concatenated with NO spaces nor + signs
Example: email: name@domain.com
password: 123456
application id: 1200
api key : c1d62nzqu7z4rig15axe72jvczib53682kapu7lk
the signature would be: SHA1(name@domain.com1234561200c1d62nzqu7z4rig15axe72jvczib53682kapu7lk)
which is: f772724acc14117f3f69784a2f505d1560afaf64
So the API call would look like (this is just an example): https://www.mediafire.com/api/user/g...505d1560afaf64
Make sure the the application exists and that the app id corresponds to the api key. To create an App, visit your MediaFire account and go to "My Account > Developers" section. The API key is a secret key. Make sure you keep it private.
Thank you.
-
Aug 20th, 2014, 07:58 AM
#7
Registered User
Re: Mediafire API help
hi,i know this is really old thread but i need some help, so don't mind me.I am trying to use the get_info api to get the user information but i am having a problem generating a call signature(Session token 2).
http://www.mediafire.com/developers/...call_signature
I am reading the documentation given in the above link where it says to generate the call signature we need the formula
The signature = the Message-Digest (MD5) of the 'secret_key' modulo 256 + 'time' + the URI of the API call. .
I have the secret_key and time which i got from calling get_session_token api.The problem lies (i guess) in the URI of the API call.
In my case , i wanted to call the get_info api , so i replace the URI with "/api/user/get_info.php" .But i got error saying i have invalid signature.What am i doing wrong here?
-
Aug 20th, 2014, 02:23 PM
#8
Thread Starter
Lively Member
Re: Mediafire API help
Your best bet is to contact their support, or if rabie80 comes back here. Their documentation is still not flawless...
-
Aug 20th, 2014, 10:50 PM
#9
Registered User
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|