cancel
Showing results for 
Search instead for 
Did you mean: 

REST API with XML Inputs and Outputs

Saravanan
Contributor III

I am just practicing to call REST APIs using XML values.  I have tried to create a Contacts record using REST API and XML request in Archer API Template application.  Its throwing 400 bad request.  Default JSON input worked successfully.

The XML Input:

<?xml version="1.0" encoding="UTF-8" ?>
<Content>
<LevelId>37</LevelId>
<Tag>Contacts</Tag>
<FieldContents>
<531>
<Type>1</Type>
<Tag>First Name</Tag>
<Value>User1</Value>
<FieldId>531</FieldId>
</531>
<543>
<Type>1</Type>
<Tag>Last Name</Tag>
<Value>Test</Value>
<FieldId>543</FieldId>
</543>
</FieldContents>
</Content>

Does Archer REST APIs accept XML String as an input? If yes, do we have any material on how to create input xml string for rest apis?

 

Also, in POSTMAN, i tried to read a Contacts record using Content Type as "text/xml; charset=utf-8".  But i am getting the same JSON results.  But i want the result in XML.  What am i doing wrong?

5 REPLIES 5

Arun.Prasad
Advocate II

Saravanan Rajaram,

 

Also, in POSTMAN, i tried to read a Contacts record using Content Type as "text/xml; charset=utf-8".  But i am getting the same JSON results.  But i want the result in XML.  What am i doing wrong?

 

Did you try changing the "Accept" header to "application/xml"?

Yes, my Acccept header is "[{"key":"Accept","value":"application/json,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8","description":""}]".

Can you try by just passing "application/xml" alone in the request header?

RobWilder
Contributor III

What Archer API template application are you referring to?