Skip to main content
Solved

HTTPCaller POST: error "415"

  • July 2, 2021
  • 2 replies
  • 77 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • 571 replies
  • 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.


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