Hello Community,
I would like to connect to JIRA platform to extract all tickets for audit and control purposes: tickets open, tickets pending review, tickets closed, etc.
I try to connect to JIRA with Rest API
var
client: TRESTClient;
request: TRESTRequest;
signature: string;
Base64: TBase64Encoding;
Str1: String;
begin
client := TRESTClient.Create(nil);
try
client.BaseURL := 'https://****.atlassian.net:****';
request := TRESTRequest.Create(nil);
request.Client := client;
try
request.Method := rmGet;
request.Resource := '/rest/servicedeskapi/request/*****/comment';
signature := 'username:password';
Base64 := TBase64Encoding.Create(0);
signature := 'Basic ' + Base64.Encode(signature);
request.Params.AddItem('Authorization', signature, TRESTRequestParameterKind.pkHTTPHEADER, [poDoNotEncode]);
request.Execute;
Unfortunatly, i get an error in return :
ERROR - {"message":"Client must be authenticated to access this resource.","status-code":401}
Any idea how to solve this ?