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

update customer by ID 404 #214

Open
lrkwz opened this issue Mar 1, 2024 · 0 comments
Open

update customer by ID 404 #214

lrkwz opened this issue Mar 1, 2024 · 0 comments

Comments

@lrkwz
Copy link

lrkwz commented Mar 1, 2024

Updateing by userId fails with 404

    @Test
    public void updateContact() throws MailjetException {
        final String randomName = generateRandomUsername();

        final int contactID = addContact(randomName, randomName + "@example.com");
        assertThat(contactID).isGreaterThan(0);

        final MailjetRequest request = new MailjetRequest(Contact.resource, contactID)
                .setBody(new HashMap<>(Map.of("Name", "Mario Rossi")));
        final MailjetResponse response = client.put(request);
        assertThat(response.getStatus()).isEqualTo(200);
    }

returns

com.mailjet.client.errors.MailjetClientRequestException: { "ErrorInfo" : "", "ErrorMessage" : "Object not found", "StatusCode" : 404 }

	at com.mailjet.client.MailjetResponseUtil.validateMailjetResponse(MailjetResponseUtil.java:37)
	at com.mailjet.client.MailjetClient.parseResponse(MailjetClient.java:297)
	at com.mailjet.client.MailjetClient.put(MailjetClient.java:192)
	at learning.MailJetApiTest.updateContactById(MailJetApiTest.java:237)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
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