mailjet / mailjet-gem

[API v3] Mailjet official Ruby GEM
https://dev.mailjet.com
Other
130 stars 72 forks source link

Contactdata - Difference between Gem and Curl results #181

Closed ghost closed 4 years ago

ghost commented 5 years ago

Hi,

I am trying to list the contact data for a specific contact.

Curl : https://api.mailjet.com/v3/REST/contactdata/123456 { "Count" : 1, "Data" : [{ "ContactID" : 123456, "Data" : [{ "Name" : "firstname", "Value" : "XXX" }, { "Name" : "lastname", "Value" : "XXX" }, { "Name" : "company", "Value" : "XXX" }, { "Name" : "language", "Value" : "xx" }], "ID" : 123456 }], "Total" : 1 } I here find strange that count = 1 and total=1 as there are many contact data fields, but I can deal with that later.

Gem

RestClient.get "https://api.mailjet.com/v3/REST/contactdata/123456", "Accept"=>"application/json", "Accept-Encoding"=>"deflate", "Content-Type"=>"application/json", "User-Agent"=>"mailjet-api-v3-ruby/1.5.4"

# => 200 OK | application/json 101 bytes

=> #<Mailjet::Contactdata:0x00005617c6b82598 @attributes={"persisted"=>true, "contact_id"=>123456, "data"=>[], "id"=>123456}>

There is nothing else here, however the end point seems correct.

is there anything to set here to get the actual contact data list?

xab3r commented 4 years ago

@baptiste-pipplet I'm seeing the response size is 101 bytes, which is pretty similar to { "Count" : 1, "Data" : [{ "ContactID" : 123456, "Data" : [], "ID" : 123456 }], "Total" : 1 } ~ 93 bytes (probably real IDs add few bytes). And this is pretty weird, I cannot reproduce it. Are you still experiencing the issue?

xab3r commented 4 years ago

Closed due to inactivity. Feel free to reopen the issue if the problem occurs again.