/    Sign up×
Community /Pin to ProfileBookmark

Beginner API Key Question

Hello.

I was wondering if anyone would be able to assist me with a question I have regarding an API KEY.

I am developing a small application which makes use of an API. I have been given the documentation and API key but cannot seem to get it working and am worried I might be doing something wrong. In the documentation, their is a line that states:

APIKey Formula: md5 (“[your API secret]” + md5 (“API@***********E”))

Would this be the correct way to do this is in PHP:

$secret = md5(“d35y……8k01”);
$appid = md5(“API@……..E”);

$apikey = md5($secret . $appid);

If I do try and use that formula to get the APIkey I get an error of “wrong api key” so I am not sure if I am constructing it wrong or if there is something else I am not getting right.

Thank you for any assistance.

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@ginerjmJan 27.2020 — What you have done is NOT what the documentation says to do. You are encoding two values separately and then joining them and encoding them again. Why?

Of course it may not make a difference but if you want to do what they said to do, stop using the md5 call on your assignments of $secret and $appid.
Copy linkTweet thisAlerts:
@SethanauthorJan 27.2020 — I apologize for not understanding correctly.

So if I am understanding correctly, using PHP, the correct way to do this would be:


$key = md5("d35y......8k0" . "[email protected]");


IF this correct, how would I manage to so this for a program like Postman for example? Thank you for the help and I apologize for the mistake.
Copy linkTweet thisAlerts:
@campingrhinoJan 27.2020 — @Sethan#1613712 From what your first post suggests, the secret doesn't need md5-ing. So you would just emit that:

$secret = "d35y......8k01";<br/>
$appid = md5("[email protected]");<br/>
$apikey = md5($secret . $appid);


EDIT: As for your question about Postman, you're probably best to just echo that and copy it over manually. As far as I know, there isn't a way to do this kind of thing in Postman.
Copy linkTweet thisAlerts:
@ginerjmJan 27.2020 — My bad. I mis-read the api key instruction myself. Please follow campingrhino's advice.
Copy linkTweet thisAlerts:
@SethanauthorJan 27.2020 — @campingrhino#1613713

Thank you so much this worked! Now i am getting an error of method not available when using GET or POST. Those are the only 2 I will be using as far as I know so I am not sure why it is telling me method not available.

Thank you for the help though, I really appreciate it.

EDIT: The methods were my error again. The error was referring to different methods: Categories, Distance etc
×

Success!

Help @Sethan spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...