Subversion Repositories VORC

Rev

Rev 235 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 235 Rev 236
Line 7... Line 7...
7
use WebDB;
7
use WebDB;
8
use REST::Client;
8
use REST::Client;
9
use JSON;
9
use JSON;
Line 10... Line 10...
10
 
10
 
11
my $dbh = WebDB::connect ();
11
my $dbh = WebDB::connect ();
Line 12... Line 12...
12
my $headers = { Authorization => '601037851507c624' };
12
my $headers = { Authorization => getSetting ("WRSTBND_API_KEY") };
Line 13... Line 13...
13
 
13
 
14
print "Bulk adding class registrations...\n";
14
print "Bulk adding class registrations...\n";
Line 38... Line 38...
38
  my $response = from_json($client->responseContent());
38
  my $response = from_json($client->responseContent());
Line 39... Line 39...
39
 
39
 
40
  #print Dumper $response;
40
  #print Dumper $response;
41
  my $activationCode = $response->{activationCode};
41
  my $activationCode = $response->{activationCode};
42
  print $activationCode."...";
-
 
-
 
42
  print $activationCode."...";
43
  
43
  my $api_key = getSetting ("WRSTBND_API_KEY");
44
  my $add_response = `/bin/curl --location 'https://core.wrstbnd.io/rest/core/v1/assign' --header 'Authorization: 601037851507c624' --form accountid=$accountid --form ticketactcode=$activationCode --output /dev/null --silent --write-out '%{http_code}\n'`;
44
  my $add_response = `/bin/curl --location 'https://core.wrstbnd.io/rest/core/v1/assign' --header 'Authorization: $api_key' --form accountid=$accountid --form ticketactcode=$activationCode --output /dev/null --silent --write-out '%{http_code}\n'`;
45
  print $add_response;
45
  print $add_response;
46
  $assignment->execute ($activationCode, $id, $rcid, 'CLA-%') unless $add_response ne "200";
46
  $assignment->execute ($activationCode, $id, $rcid, 'CLA-%') unless $add_response ne "200";