andreweatherman / cbbdata

https://cbbdata.aweatherman.com
Other
12 stars 2 forks source link

cbd_create_account() returns error #6

Closed gabeosterhout closed 8 months ago

gabeosterhout commented 8 months ago
Error in `req_perform()`:
! HTTP 400 Bad Request.
---
Backtrace:
    ▆
 1. ├─cbbdata::cbd_create_account(...)
 2. │ └─... %>% req_perform()
 3. └─httr2::req_perform(.)
 4.   └─httr2:::handle_resp(req, resp, error_call = error_call)
 5.     └─httr2:::resp_abort(resp, req, body, call = error_call)
 6.       └─rlang::abort(...)
andreweatherman commented 8 months ago

This usually occurs if your selected username already exists. Try to register under a different username and let me know if the error persists.

I just created a dummy account and it worked, so I'm guessing the username is throwing you an issue.

gabeosterhout commented 8 months ago

Appreciate the quick response! Excited to explore the package.

The username was pretty unique but I tried a few others just in case. Slightly different error now.

<error/httr2_http_409>
Error in `req_perform()`:
! HTTP 409 Conflict.
---
Backtrace:
    ▆
 1. ├─cbbdata::cbd_create_account(...)
 2. │ └─... %>% req_perform()
 3. └─httr2::req_perform(.)
 4.   └─httr2:::handle_resp(req, resp, error_call = error_call)
 5.     └─httr2:::resp_abort(resp, req, body, call = error_call)
 6.       └─rlang::abort(...)
andreweatherman commented 8 months ago

That error typically means that your email is associated with an account and you are attempting to register with a new username. Each account must have a unique, distinct email.

I'll be sure to add these error codes to the documentation later as well.

gabeosterhout commented 8 months ago

You are right. Didn't realize API credentials were shared with another package. Thanks for your quick help!