tapajos / highrise

Ruby wrapper around Highrise API.
MIT License
124 stars 77 forks source link

Avatar URL causing 422s #74

Closed bdubaut closed 5 years ago

bdubaut commented 8 years ago

Hi, I am encountering an odd behaviour from the API. Maybe it's because I am not using the wrapper right, if so please correct me. I try to create a person in Highrise like this:

person = Highrise::Person.new
person.first_name = 'some name'
person.last_name = 'some last name'
person.avatar_url = 'https://my-url.com/image.jpg'
person.contact_data =  { email_addresses: [{ address: 'mail@me.com' }] }
person.save

I am getting a 422 error like this one:

irb(main):024:0> person.errors
=> #<ActiveResource::Errors:0x007f41828777b8 @base=#<Highrise::Person:0x007f4182cb43d0 @attributes={"subject_datas"=>[], "first_name"=>"some name", "last_name"=>"some last name"
, "email"=>"info@bundles.nl", "avatar_url"=>"https://my-url.com/image.jpg", "contact_data"=>{"email_addresses"=>[{"address"=>"mail@me.com"}]}}, @prefix_options={}, @persisted=false,
 @remote_errors=#<ActiveResource::ResourceInvalid: Failed.  Response code = 422.  Response message = Unprocessable Entity.>, @validation_context=nil, @errors=
#<ActiveResource::Errors:0x007f41828777b8 ...>>, @messages={}>

The save is successful if I remove the avatar_url attribute. Am I doing this wrong? The official API repo has that avatar-url attribute too. Thanks a lot

bdubaut commented 5 years ago

This looks quite inactive now. I'll close it as it pollutes my issues list.