crisp-im / ruby-crisp-api

💎 Crisp API Ruby Wrapper
https://docs.crisp.chat/guides/rest-api/
MIT License
16 stars 7 forks source link

Error in client.website.add_new_people_profile #1

Closed catacs closed 6 years ago

catacs commented 6 years ago

I am trying to use the api method client.website.add_new_people_profile and i get this error:

    /gems/crisp-api-1.0.2/lib/crisp-api.rb:114:in `_do_request': invalid_data (RouteError)
        from /gems/crisp-api-1.0.2/lib/crisp-api.rb:65:in `post'
        from /gems/crisp-api-1.0.2/lib/resources/website.rb:189:in `add_new_people_profile'
        from crisp_test.rb:14:in `<main>'

it seems the method add_new_people_profile is not using the data parameter:

def add_new_people_profile(website_id, data)
    return @parent.post(self._url_website(website_id, "/people/profile"))
end

it should be:

def add_new_people_profile(website_id, data)
    return @parent.post(self._url_website(website_id, "/people/profile"), data: data)
end
valeriansaliou commented 6 years ago

Thanks, issuing a fix now.

valeriansaliou commented 6 years ago

All fixed, you can install v1.0.3 from Rubygems.