EmmaSharp icon indicating copy to clipboard operation
EmmaSharp copied to clipboard

RemoveMembersFromGroup api call fails when returned ids too big for int32

Open aqez opened this issue 6 years ago • 1 comments

RemoveMembersFromGroup needs to return List instead of List in EmmaSharp\Groups.cs public List<int> RemoveMembersFromGroup(string memberGroupId, MemberIdList memberIds) should be.. public List<long> RemoveMembersFromGroup(string memberGroupId, MemberIdList memberIds)

Below is stack trace from a live call that is failing for me.

Newtonsoft.Json.JsonReaderException: JSON integer 2169469051 is too large or small for an Int32. Path '[0]', line 2, position 12.
   at Newtonsoft.Json.JsonTextReader.ParseReadNumber(ReadType readType, Char firstChar, Int32 initialPosition)
   at Newtonsoft.Json.JsonTextReader.ReadNumberValue(ReadType readType)
   at Newtonsoft.Json.JsonTextReader.ReadAsInt32()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at EmmaSharp.EmmaApi.Execute[T](RestRequest request, Int32 start, Int32 end)
   at EmmaSharp.EmmaApi.RemoveMembersFromGroup(String memberGroupId, MemberIdList memberIds)

aqez avatar Dec 06 '19 16:12 aqez

I am having a similar issue with getting an individual Mailing.

I am using ListMailings() and then doing Select() to transform the list to include the WebviewUrl, but I get a similar error:

JSON integer 265285948 is too large or small for an Int32. Path 'links[0].link_id', line 10, position 27.

codebytimlong avatar May 26 '22 19:05 codebytimlong