api-documentation icon indicating copy to clipboard operation
api-documentation copied to clipboard

Bad attributes formatting for Subscriptions managecontactslists

Open dfabreguette opened this issue 3 years ago • 0 comments

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"
          }
        ])

dfabreguette avatar Jan 19 '22 11:01 dfabreguette