Sure Master, Can you please check below code> I would like to use the access_token value retrieved from webapp.pm in sub api_call3 $value2

package Op; use strict; use warnings; use Win32::Process; use Storable; use IO::Socket::SSL; use REST::Client; use JSON::Parse ':all'; use MIME::Base64; use Term::ReadKey; use Data::Dumper; use MIME::Lite; use Net::SMTP; use webapp qw/@access_token/; use Spreadsheet::XLSX; use Spreadsheet::ParseXLSX; use Excel::Writer::XLSX; sub api_call3 { $client->default_header( 'content-type' => 'application/json' ); $client->default_header( 'Accept' => 'application/json' ); $client->default_header( 'Authorization' => "Bearer $value2" ); $client->request(HTTP::Request->new('GET', "$_[0]")); } sub result3 { my ($args) = @_; my $oktadev = $args->{OKTAUsersList}; my $email = $args->{Email}; my @responsetext; my @responsalter; $strExcelFilename1 = "C:/PERL/" . "OKTADev-Profile-User-Details" . + $date . ".xlsx"; my $apiurlapplog2 = "https://dev.oktapreview.com" ."/api/v1/users? +"; my $response = api_call3($apiurlapplog2); print "Response:\n"; @responsetext = parse_json ($response->content); my $workbook = Excel::Writer::XLSX->new( $strExcelFilename1 ); for my $i (0..$#responsetext) { my $responseid = $responsetext[$i]{id}; my $responsests = $responsetext[$i]{status}; if ($responsests ne "DEPROVISIONED") { $worksheet->write(0, 0, 'OKTA-ID'); $worksheet->write(0, 1, 'FIRST NAME'); $worksheet->write(0, 2, 'LAST NAME'); $worksheet->write($r, 0, $responseid); $worksheet->write($r, 1, $responsetext[$i]{profile}{firstName}); $worksheet->write($r, 2, $responsetext[$i]{profile}{lastName}); $r += 1; } } }

In reply to Re^6: Unable to execute the get method from app.psgi file for Dancer2 app. by chandantul
in thread Unable to execute the get method from app.psgi file for Dancer2 app. by chandantul

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.