Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad attributes formatting for Subscriptions managecontactslists #36

Open
dfabreguette opened this issue Jan 19, 2022 · 0 comments
Open

Comments

@dfabreguette
Copy link

dfabreguette commented Jan 19, 2022

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"
          }
        ])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant