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
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 754 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive