Nein, dass weiß ich nicht.
Aber wie würde ich bei meiner Function einen Header eingeben? Ich habe es jetzt so versucht:
Delphi-Quellcode:
function cUrlCall:
string;
var client : TRESTClient;
request : TRESTRequest;
begin
client := TRESTClient.Create('
https://api-eu.dhl.com');
try
client.SetHTTPHeader('
DHL-API-Key','
xxXXXxxXXXXXxxXX');
request := TRESTRequest.Create(client);
request.Method := rmGet;
request.Resource := '
track/shipments';
request.AddParameter('
trackingNumber', '
00341434296527125347', pkGETorPOST, []);
request.Execute;
Result:= request.GetFullRequestURL;
Result := Result + '
// Result:' + request.Response.Content;
finally
client.Free;
end;
end;
Leider bekomme ich nach wie vor das Ergebnis:
Code:
Result:{"status":401,"title":"Unauthorized","detail":"Unauthorized for given resource."}
From DHL documentation i see these :
https://developer.dhl.com/api-refere...de--get-access
https://developer.dhl.com/api-refere...e-docs-section
So the question is did you replaced xxXXXxxXXXXXxxXX with your actual key ?
Try that with curl and don't post your key here.
just try with curl until it does work, also you might want to switch to the DHL test server
https://developer.dhl.com/api-refere...e-docs-section