mailjet / api-documentation

Mailjet API Guides
https://dev.mailjet.com/guides
22 stars 25 forks source link

Bad attributes formatting for Subscriptions managecontactslists #36

Open dfabreguette opened 2 years ago

dfabreguette commented 2 years ago

Hi, just to let you know, there's a mistake in the managecontactslists contact_lists attributes formatting here (both in API reference and Guides) : https://dev.mailjet.com/email/guides/contact-management/#manage-the-subscription-status-of-an-existing-contact

in the examples in ruby mode : Capture d’écran 2022-01-19 à 12 32 01

I got this error :

Mailjet::ApiError (error 400 while sending #<RestClient::Resource:0x00007fdd8dc38b20 @url="https://api.mailjet.com/v3/REST/contact/XXX/managecontactslists", @block=nil, @options={:public_operations=>[:post], :read_only=>nil, :perform_api_call=>true, :open_timeout=>nil, :read_timeout=>nil, :user=>"XXX", :password=>"XXX", :content_type=>"application/json"}> to https://api.mailjet.com/v3/REST/contact/10421273/managecontactslists with {"ContactsLists"=>[{"action"=>"addnoforce", "list_id"=>"XXX"}]})

Until I changed my formatting to :

Mailjet::Contact_managecontactslists.create(
        id: any_mailjet_contact.id,
        contacts_lists: [
          {
            "Action" => "addnoforce",
            "ListID" => "xxx"
          }
        ])