Rest Api for Flash Talking - XML through POST

revelationdigi
Member
Hey Guys!
I need to push XML request through POST for flashtalking api.
Code below:
httprequest.addHeader('Authorization', 'Basic ' + DOMO.b64EncodeUnicode(metadata.account.username + ':' + metadata.account.password));
var res = httprequest.get('https://request.flashtalking.net/authenticate/xxxxxxxxappkey');
//token extraction
var token = res.substring(92, 124);
DOMO.log('token: ' + token);
httprequest.addHeader('Authorization', 'Basic ' + DOMO.b64EncodeUnicode('appkey' + '||' + 'devkey' + ':' + token));
var xml = '<?xml version="1.0"?>'+
'<request>' +
' <name>testapiclient23</name>' +
'</request>';
var post = httprequest.post('https://request.flashtalking.net/client',xml);
DOMO.log(' post : ' + post);
When I use:
var post = httprequest.post('https://request.flashtalking.net/client',xml);
Console gives me follwing error:
post : method POST must have a request body.
When I modify it to:
var post = httprequest.post('https://request.flashtalking.net/client',{body:xml});
Api response is:
<?xml version="1.0"?>
<response><request>client</request><function>create</function><error>args not complete:name</error><token>90f6e2a9d6f42c1d5ee44dc249c212f7</token><httpstatus>400</httpstatus><message>bad request.</message></response>
Error 400 - Bad request.
I am pretty sure that Flash Talki api doesn't recognize my XML request, not sure why though.
Any help will be appreciated.
0
Best Answer
-
0
Answers
-
0
This discussion has been closed.
Categories
- All Categories
- Product Ideas
- 2.1K Ideas Exchange
- Connect
- 1.3K Connectors
- 309 Workbench
- 7 Cloud Amplifier
- 10 Federated
- Transform
- 663 Datasets
- 119 SQL DataFlows
- 2.3K Magic ETL
- 823 Beast Mode
- Visualize
- 2.6K Charting
- 86 App Studio
- 46 Variables
- Automate
- 193 Apps
- 483 APIs & Domo Developer
- 87 Workflows
- 23 Code Engine
- AI and Machine Learning
- 23 AI Chat
- 4 AI Projects and Models
- 18 Jupyter Workspaces
- Distribute
- 117 Domo Everywhere
- 283 Scheduled Reports
- 11 Software Integrations
- Manage
- 143 Governance & Security
- 11 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 116 Community Announcements
- 5K Archive