Skip to main content
Solved

HTTPCaller POST: error "415"


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>

 

Best answer by caracadrian

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.

View original
Did this help you find an answer to your question?

2 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • Best Answer
  • July 2, 2021

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.


caracadrian wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings