Issue with domain#create
- Dominant language
- Ruby
- Stars
- 216
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
I'm hoping I'm just doing something wrong here. When calling `heroku.domain.create()`, I'm getting a 400 error.
To start, here's what works.
```ruby
irb(main):003:0> heroku.domain.list('app12345@heroku.com')
=> [{"acm_status"=>nil, ...}]
irb(main):004:0> heroku.domain.delete('app12345@heroku.com', '*.example.com')
=> {"acm_status"=>nil, ...}
# I was able to confirm that this does delete the domain
```
And here's what doesn't.
```ruby
irb(main):005:0> heroku.domain.create('UUID_HERE', '*.example.com')
Excon::Error::NotFound: Expected([200, 201, 202, 204, 206, 304]) <=> Actual(404 Not Found)
irb(main):006:0> heroku.domain.create('my-app-name', '*.example.com')
Excon::Error::BadRequest: Expected([200, 201, 202, 204, 206, 304]) <=> Actual(400 Bad Request)
irb(main):007:0> heroku.domain.create('app12345@heroku.com', '*.example.com')
Excon::Error::BadRequest: Expected([200, 201, 202, 204, 206, 304]) <=> Actual(400 Bad Request)
```
Our API docs suggest that either the UUID or app name should suffice (even the heroku_id works in the `delete` example above!), which makes me wonder why using the UUID returns a 404 while the app name example returns a 400.
Am I just doing something dumb? It seems pretty straightforward.
***Update:*** in a humbling turn of events, the alternate error I was receiving above for the UUID method was indeed valid; I somehow had the wrong UUID for the app. correcting this yields the same 400 BadRequest error the other two commands were returning.
Using `EXCON_DEBUG` returns the following (assuming the important bits, omitting others - let me know if you need something else):
```
:body => "\"*.example.com\""
:host => "api.heroku.com"
:hostname => "api.heroku.com"
:method => :post
:path => "/apps/UUID_HERE/domains"
```
Contributor guide
Assessment
This issue has not been assessed yet.