greg6775 / Discord-Api-Endpoints

A list of useful Discord API endpoints
141 stars 23 forks source link

Discord API Account Creation Endpoint #4

Open 0w9 opened 3 years ago

0w9 commented 3 years ago

Hello,

how do i use the /auth/register endpoint to register a account?

Congrats

greg6775 commented 3 years ago

Hello,

You have to send a POST request with the following payload:

{
  "fingerprint": "",
  "email": "",
  "username": "",
  "password": "",
  "invite": null,
  "consent": true,
  "date_of_birth": "2000-01-01",
  "gift_code_sku_id": null,
  "captcha_key": null
}

If the request is successful, a status code 201 is returned along with a JSON body containing a token value.

0w9 commented 3 years ago

Thank you for the reply! What is the fingerprint in this case?

The captcha key is the sitekey of the hcaptcha, right? Do the values of fingerprint and captcha change?

greg6775 commented 3 years ago

You can get the value for the fingerprint by sending a POST request to /auth/fingerprint. I believe a fingerprint can only be used once. And no, I don't think that the captcha key is the sitekey. But I am not sure about this. Keep me updated if you figure it out.

0w9 commented 3 years ago

Thank you so much for the help. I will let you know when I made a call that worked.

0w9 commented 3 years ago

Looks like there is not api for the fingerprint... any idea how to get this?

greg6775 commented 3 years ago

You can get the value for the fingerprint by sending a POST request to /auth/fingerprint.

Did you try this?

0w9 commented 3 years ago

Yes. https://discord.com/api/auth/fingerprint retuns me a {"message": "405: Method Not Allowed", "code": 0}

greg6775 commented 3 years ago

Use https://discord.com/api/v9/auth/fingerprint instead. You forgot to specify an API version.

0w9 commented 3 years ago

Oh, yes. xD Is there anything i need to specify in the headers?

greg6775 commented 3 years ago

No.

0w9 commented 3 years ago

Okay, because i still get a {"message": "405: Method Not Allowed", "code": 0}.

greg6775 commented 3 years ago

Did you send a POST request? And you may have to specify a "Host" value as a header.

0w9 commented 3 years ago

Oh i got it now... it was a missing user agent.

0w9 commented 3 years ago

{ "fingerprint": "837361317714722836.XXX" }

greg6775 commented 3 years ago

Yeah. that's the fingerprint. But it is very weird that you have to specify a user agent. For me it is working without the specification of one. Have you figured out a solution for the captcha_key field yet?

0w9 commented 3 years ago

No not yet, but i think it is:

  1. The site-key or
  2. The soloution-key of the captcha

The soulution can be gotten by using a hcaptcha-solve api (2captcha.com), getting the sitekey, make a request to the 2captcha API and get the captcha-key.

greg6775 commented 3 years ago

Yeah, it is the solution key. But the 2captcha API wasn't free. Am I right?

0w9 commented 3 years ago

Yes, it was like 0,001$ per captcha, but that is okay for me. The problem is that there is not other method because 2captcha just has tons of people solving them on a dashboard 24/7.

0w9 commented 3 years ago

I just need to figure out how this can work the best. I think i need to use bs4 to get the site-key, make a request to 2captcha and then get the fingerprint + register the account.

taytanqbpass commented 3 years ago

hey @GregTCLTK what's next after the /auth/register endpoint? i currently get a 201 and a token. Thanks.

greg6775 commented 3 years ago

After you got the token, you're able to use the other API endpoints. Just don't forget to include the token you received in the request.

taytanqbpass commented 3 years ago

hey @GregTCLTK thank you for the response. do you have a discord? I would like to ask more questions regarding this. Thanks.

IllegalWeaponsDealer commented 2 years ago

i get 400 captcha_key:(1) ['invalid-response'] with all the correct info and a valid captcha key solved by 2captcha does anyone know why i would get this?

JackGod001 commented 1 year ago

我得到 400 个 captcha_key:(1) ['invalid-response'],其中包含所有正确的信息和由 2captcha 解决的有效验证码密钥,有人知道我为什么会得到这个吗?

me too 。 I canot pass

greg6775 commented 1 year ago

i get 400 captcha_key:(1) ['invalid-response'] with all the correct info and a valid captcha key solved by 2captcha does anyone know why i would get this?

Keep in mind that Discord switched from reCAPTCHA to hCAPTCHA a while back. Therefore, you have to specify a hCAPTCHA key for the captcha_key field.