Forum - 401 – Not authorized

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #76312
    46VITT_INST
    Participant

    Hi,

    I am trying to do some create users requests towards the sandbox. I have api key created for that purpose. There is my code:

    var almaSandboxUrl = “https://sandbox02-eu.alma.exlibrisgroup.com/almaws/v1/users”;

    HttpClient client = new();
    StringContent newUserContent = new StringContent(userToCreate, Encoding.UTF8, “application/json”);

    client.DefaultRequestHeaders.Accept.Clear();
    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(“application/json”));
    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(“apikey”, almaSandboxApiKey);

    var response = await client.PostAsync(almaSandboxUrl, newUserContent);
    var jsonResponse = await response.Content.ReadAsStringAsync();

    I’ve tried with query parameter as well, still the same error: 401 – Not Authorized.

    #146104
    Ori Miller
    Keymaster

    Please see https://developers.exlibrisgroup.com/alma/apis/
    Access should be done via the API Gateways.
    You configure the API-key to access your prod or sand environment.
    Ori

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.