0

Code Transformation

function integer transform() {
    $out.0.requestContent = $in.o.json_file;
    $out.0.charset = "UTF-8";

    $out.0.URL = "https://api.abcd.com/applicationname/apiname";
    $out.0.requestMethod = "POST";
    $out.0.oAuthAccessToken = dictionary.TOKEN;

    return ALL;
}

I am working on building a clover graph. My goal is to get the bearer token by calling http connector using authentication - 'HTTP BASIC' first and then use this token to call other APIs. I am able to accomplish the fist part but unable to pass the token as there are just two authentication methods available - (HTTP BASIC, HTTP DIGEST). Any suggestions on how to achieve second part would be greatly appreciated.

CloverETL - 4.4.0.11

I got the token stored in a directory

graph is expected to post the JSON data to the api using bearer token

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
  • Please provide what you did so far. – user2738882 Jul 29 '19 at 20:11
  • I have managed to save the token in a dictionary by calling session api, issue is that I am not able to send it over while calling other api. – Omkar Shanware Jul 29 '19 at 21:23
  • I am trying to set the Additional Http headers property to {Content-Type=application/json, Authorization=Bearer dictionary.TOKEN} but this isn't working. If I replace dictionary.TOKEN with actual token value it works. – Omkar Shanware Jul 29 '19 at 21:34
  • Try to send token over the edge, in some field, without dictionary. Use content of the record from input port to build additional http header property in transform() function directly. – Dolfa Aug 05 '19 at 16:05

0 Answers0