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

SDK won't work, unexpected response API ERROR 2 #73

Closed
ohdonpiano opened this issue May 15, 2023 · 1 comment
Closed

SDK won't work, unexpected response API ERROR 2 #73

ohdonpiano opened this issue May 15, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@ohdonpiano
Copy link

Describe the bug

the response of createOrUpdate SDK API is:

["Contact request failed with error: Impossibile completare l'operazione. (Errore MailchimpSDK.APIError 2)."]
["API Error status: 404"]
["API Error detail: Unknown"]
["API Error type: Unexpected response"]

To Reproduce

created an SDK key for the default audience
installed latest version of SDK 2.0.4 via cocoapods

used this code:

Future { promise in
print("endBetaTest called with email: (email)")
do {
try Mailchimp.initialize(token: Environment.MAILCHIMP_KEY, autoTagContacts: true, debugMode: true)
} catch {
promise(.failure(error))
return
}
var contact = Contact(emailAddress: email)
Mailchimp.createOrUpdate(contact: contact) { result in
switch result {
case .success:
print("Successfully added or updated contact")
promise(.success(true))
case .failure(let resError):
print ("Mailchimp error: (resError.localizedDescription)")
switch resError {
case .jsonParsingError(let err):
print ("Mailchimp json parsing error: (err)")
promise(.failure(RDError(err)))
case .requestError(let err):
print ("Mailchimp request error: (err)")
promise(.failure(RDError(err)))
default:
promise(.failure(RDError(resError.localizedDescription)))
}
}
}
}

Expected behavior

the contact added in the audience

Development Environment Information:

  • Xcode Version: 14.3
  • iOS Deployment Target: iOS 13.0
  • Mailchimp SDK Version: 2.0.4

Podfile contents

platform :ios, '13.0'

target 'MyApp' do

pod 'MailchimpSDK'

end

Additional context

Tried also Android with same 404 result, logcat gives these logs:

--> POST https://us21.api.mailchimp.com/clientapi/1.0/contacts
<-- 404 https://us21.api.mailchimp.com/clientapi/1.0/contacts (456ms)

Apache Server at us21.api.mailchimp.com Port 80 Worker result RETRY for Work [ id=a8c0a846-a06f-4808-b565-5749120d6a8c, tags={ com.mailchimp.sdk.audience.AudienceWorker } ]
@ohdonpiano ohdonpiano added the bug Something isn't working label May 15, 2023
@jey-starratt
Copy link
Collaborator

@ohdonpiano Thank you for reaching out to us and providing a descriptive report. We've investigated and resolved the underlying issue. Let us know if you run into anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants