Skip to main content

Hello,

I am trying to POST an XML using the HTTP Caller, but get a 415 error.

I have an API tool for the application that I am trying interact with, and manage to POST the XML with success.

I have seen other posts that suggest it is the header of the XML / Content Type option which is incorrect, but I have tried all the options I can think of.

 

Any help would be appreciated. 

I have pasted the XML I am using below, and attached the test  workbench I'm using. 

Note that I have deleted credentials / sensitive information.

Cheers

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Mail>
<TotalAttachmentCount>0</TotalAttachmentCount>
<Confidential>false</Confidential>
<RichMailText>false</RichMailText>
<MailSubject>TEST2</MailSubject>
<ToUserId>1476934057</ToUserId>
<MailTypeId>2154</MailTypeId>
<MailFormFields>
<MailFormField identifier="DesignPackage_singleSelect">N/A - Not Applicable</MailFormField>
<MailFormField identifier="Discipline_singleSelect">PM - Project Management</MailFormField>
<MailFormField identifier="Contractprogram_singleSelect">***SOMETHING HERE***</MailFormField>
<MailFormField identifier="Location_singleSelect">ALL - Project Wide</MailFormField>
</MailFormFields>
</Mail>

 

You should look into the API docs Mail | Support Central (aconex.com)

Aconex requires you to supply both a Header and a POST payload and setting the Content Type manualy.


You should look into the API docs Mail | Support Central (aconex.com)

Aconex requires you to supply both a Header and a POST payload and setting the Content Type manualy.

Thank you. 

I did not know that it was possible to set the content type manually. For those interested, in the future, below is my HTTP Caller parameters and payload.

--myboundary
Content-Type: application/vnd.aconex.mail.v3+xml
 
<Mail>
<TotalAttachmentCount>0</TotalAttachmentCount>
<Confidential>false</Confidential>
<RichMailText>false</RichMailText>
<MailSubject>TEST2</MailSubject>
<ToUserId>1476934057</ToUserId>
<MailTypeId>2154</MailTypeId>
<MailFormFields>
<MailFormField identifier="DesignPackage_singleSelect">N/A - Not Applicable</MailFormField>
<MailFormField identifier="Discipline_singleSelect">GN - General</MailFormField>
<MailFormField identifier="Contractprogram_singleSelect">***</MailFormField>
<MailFormField identifier="Location_singleSelect">ALL - Project Wide</MailFormField>
</MailFormFields>
</Mail>
 
--myboundary

 

Capture


Reply