Returns the placement's invocation code of the given type as a text-file attachment, the same file the console's download button hands out.
Reference
GET https://YOUR-NETWORK-DOMAIN/rest-api/placements/{placementId}/invocation-code/export.do
Returns the placement's invocation code of the given type as a text-file attachment, the same file the console's download button hands out. Requires VIEW access to the placement's site and, for types that have one, the per-type invocation-code permission.
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("GET"), "https://YOUR-NETWORK-DOMAIN/rest-api/placements/4001/invocation-code/export.do?type=AJAX");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());