MattTW / BlinkMonitorProtocol

Unofficial documentation for the Blink Wire-Free HD Home Monitoring & Alert System
427 stars 79 forks source link

What is the endpoint I can use if I wanted to programatically create an account? #72

Open Randy1Burrell opened 1 year ago

Randy1Burrell commented 1 year ago

Hi @MattTW, thank you for this lib. One feature is missing that I need to use. If you can point me in the right direction then I can add it in myself. Do you know the REST endpoint Blink uses when creating accounts?

Thank you in advance!!

amattu2 commented 9 months ago

@Randy1Burrell

POST {{baseurl}}api/v6/account/register

Minimal Body

{
    "email": "{email}",
    "password": "{{password}}",
    "password_confirm": "{{password}}",
    "reauth": false,
    "country": "u014" // OPTIONAL: defaults to eu
}

Note: The register post body extends the login body, so I'd recommend including unique_Id, device_identifier, and client_name at a minimum.

The response is nearly identical to the login endpoint. You will need to verify the pin emailed to you. Likely using the same API endpoint as described during the login process.

Randy1Burrell commented 9 months ago

Thanks 🙏🏿 man. What is the baseurl?

amattu2 commented 9 months ago

Thanks 🙏🏿 man. What is the baseurl?

Base URL aka "initial server URL" is https://rest-prod.immedia-semi.com/

Randy1Burrell commented 9 months ago

In your experience, do they throttle your requests? I'm building something that will need to pull loads of videos from their APIs.

Randy1Burrell commented 9 months ago

Also, do you know what the country codes are? Or can you point me in the direction where I can find these details out myself?

amattu2 commented 9 months ago

@Randy1Burrell In your experience, do they throttle your requests? I'm building something that will need to pull loads of videos from their APIs.

I'm not actually sure. I just started looking into their API today. I'd recommend simulating what a typical user can do and staggering your requests.

Also, do you know what the country codes are? Or can you point me in the direction where I can find these details out myself?

I just realized the u014 country in my example isn't actually an option, so ignore that. The country code API is here:

GET https://rest-prod.immedia-semi.com/api/v1/countries

It returns a very long list otherwise I'd include it. I guess you'd pick one of those during registration.