Forum - New to Primo Rest API

  • This topic has 6 replies, 3 voices, and was last updated 1 year, 7 months ago by Patrick Thibaudeau.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #147538
    Madeline Li
    Participant

    Hi,

    I work for USPTO and we have a task to integrate our search application with Primo for search NPL. I have created a dev account and an API key. However, when I tried to try GET REST calls using the API Key, it errors out with the following error:

    <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
    <web_service_result xmlns=”http://com/exlibris/urm/general/xmlbeans”&gt;
    <errorsExist>true</errorsExist>
    <errorList>
    <error>
    <errorCode>UNAUTHORIZED</errorCode>
    <errorMessage>API-key not defined or not configured to allow this API.</errorMessage>
    </error>
    </errorList>
    </web_service_result>

    I saw the note in the primo documentation about completing the registration process to the API gateway by opening a Saleforce case. How do I do that? Thanks for your help.

    #147563
    Paul McBride
    Participant

    Hello Madeline,
    I verified the Alma and Primo VE environments used by USPTO were properly registered in the API Gateway.
    I noticed your user profile was not linked to the USPTO institution.
    I corrected your profile.
    You may now need to re-create your APIkeys.

    If you encounter further issues, I encourage you to submit a Case with Ex Libris Support.

    Thank you,
    Paul McBride
    NA Primo Tier 2 Senior Support Analyst

    #147566
    Madeline Li
    Participant

    Hi, I created a new API key and tried again. Still got the same error. I don’t know for sure the institution code but this is what I got: 01USPTO. Could you confirm?

    <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
    <web_service_result xmlns=”http://com/exlibris/urm/general/xmlbeans”&gt;
    <errorsExist>true</errorsExist>
    <errorList>
    <error>
    <errorCode>UNAUTHORIZED</errorCode>
    <errorMessage>API-key not defined or not configured to allow this API.</errorMessage>
    </error>
    </errorList>
    </web_service_result>

    #147570
    Paul McBride
    Participant

    Hello Madeline,
    In your Primo VE search url, the institution code is also the first part of the View code. (the part to the left of the colon in the vid parameter).

    If you encounter further issues, I encourage you to submit a Case with Ex Libris Support.

    Thank you,
    Paul McBride
    NA Primo Tier 2 Senior Support Analyst

    #147571
    Madeline Li
    Participant

    Hi Paul,

    Thank you. I tried using the API Console and got error code 500 back. Here is the request payload

    https://api-na.hosted.exlibrisgroup.com/primo/v1/userJwt

    Request payload:

    {
    viewId: 01USPTO

    institution: 01USPTO,

    language: en_US,

    user: madeline.li@uspto.gov,

    userName: Li, Madeline,

    userGroup: group_a,

    onCampus: false

    }

    Error response:

    {
    “errorsExist”: true,
    “errorList”: {
    “error”: [
    {
    “errorCode”: “INTERNAL_SERVER_ERROR”,
    “errorMessage”: “\nThe web server encountered an unexpected condition that prevented it from fulfilling the request. If the error persists, please use the unique tracking ID when reporting it.”,
    “trackingId”: “E01-0707154643-7I08Z-JSE993286660”
    }
    ]
    }
    }

    I don’t know what the view code is. Whatever I have provided above was something I got from USPTO library website, which interfaces with Primo. Do you know how I can get in touch with a Primo developer to work with me?

    Thanks.

    #147572
    Paul McBride
    Participant

    The Institution listed in your payload is not correct.
    Perform a Primo search and look at the vid parameter in the url. Everything to the left of the colon is the Institution code.

    Please work with the Library staff to open a Case with Ex Libris Support.

    Thank you,
    Paul McBride
    NA Primo Tier 2 Senior Support Analyst

    #147565
    Madeline Li
    Participant

    Hi,

    Thank you for answering my question. I have created a new API key with additional permissions (search, JWT, etc.) and tried to obtain a JWT with the new api key in the API console and just paste in the browser as the following:

    https://api-na.hosted.exlibrisgroup.com/primo/v1/jwt/01USPTO?lang=en_US&apikey=<my new API key>

    But I got the same errors:

    <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
    <web_service_result xmlns=”http://com/exlibris/urm/general/xmlbeans”&gt;
    <errorsExist>true</errorsExist>
    <errorList>
    <error>
    <errorCode>UNAUTHORIZED</errorCode>
    <errorMessage>API-key not defined or not configured to allow this API.</errorMessage>
    </error>
    </errorList>
    </web_service_result>

    I am not 100% certain that I got the institution and/or vid# correct. Could you share the institution code and let me know if the URL I formulated above was correct?

    Thanks.

    #150512
    Patrick Thibaudeau
    Participant

    Hello,
    Similar to the above, I created an account and an API Key. I now need to complete the registration process to the API gateway by opening a Salesforce case. How do I do that?

    Thanks for any help.

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