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

XML response is not in XML format anymore #2

Open
KodeKooker opened this issue May 23, 2017 · 1 comment
Open

XML response is not in XML format anymore #2

KodeKooker opened this issue May 23, 2017 · 1 comment

Comments

@KodeKooker
Copy link

Hi,
some times ago this call was perfectly working, I used it to get the HTML body and subject of my MailUp templates. But since some months, the output is not XML anymore: now it's a simple text string and, for this reason, my XML output parsing function is not working anymore.
Below the method invocation:

$mailUp->callMethod($mailUp->getConsoleEndpoint() . "/Console/List/1/Email/1", "GET", $reqBody, "XML");

@scigoli
Copy link
Contributor

scigoli commented May 29, 2017

Hi @KodeKooker,
Thank you for your message. At MailUp we are not facing many issues on XML because this format is rarely used and JSON format is widely preferred.

When selecting XML, the PHP code sample simply injects the returned object into the web page, leading to a bad HTML formatting when XML is chosen. According to my tests, I would exclude a problem in the API (details below). In your application you are in charge to parse the returned XML data and properly extract fields' content from it.

Hope this helps, otherwise please let me know.

Regards,

About API with XML responses
I've just tested a method call like this
curl -X GET \ https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/1/Email/1083 \ -H 'accept: application/xml' -H 'authorization: Bearer MYTOKEN -H 'cache-control: no-cache' \ -H 'content-type: application/xml'
According to the "accept: application/xml" header, the returned response is a XML object.
In addition, the response contains either the subject or the email content.

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

2 participants