Calling webapi through api call

Hi, can anyone help me how to generate web API for API Key authentication? And also how to generate the key and value needed for the API key

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi Shalini,

    I'm more than happy to provide some context on how to do this. As Stefan has mentioned below, there is some documentation on how to do this, but it it's actually really simple so I can definitely walk you through it.

    To start, assuming you've already made an API object in your application, the next step is to create a service account and bind it to the API.

    Firstly, we go to the admin console and create a new basic user. Name it according to your API, so that it can clearly be recognized as a service account. For example, if my API is called APP API Perform Functionality, I might call my service account APP API Service Account

    Next, we add them to the Service Accounts group. To do this, go to /design/objects, filter by Group, and search for "Service Account". It'll look something like this:

    Open the group and add the new user you created. Make sure to also add your new service account to whatever group gives access to the API. You can figure out what group this would be by clicking on your web api and opening the Security page.

    Finally, we bind your service account to an api key. To do this, we go back to the admin console, and navigate to the Web API Authentication section.

    From there, we click Create a New API Key. You'll be prompted to enter your service account, and provide a description. Use the description to describe what this service account will be doing (i.e. the functionality of the API).

    Once you click create, you'll be prompted to copy your API key. DO NOT IGNORE THIS PAGE, instead, copy your api key and save it somewhere safe. Make sure to also communicate this to other members of your team, so that everyone that will have to do any development involving your API will be able to run tests themselves.

    At that point, you should be all set up! Definitely let me know if you have any follow up questions or if anything I've said didn't make much sense.

    Otherwise, good luck!

Reply
  • 0
    Certified Lead Developer

    Hi Shalini,

    I'm more than happy to provide some context on how to do this. As Stefan has mentioned below, there is some documentation on how to do this, but it it's actually really simple so I can definitely walk you through it.

    To start, assuming you've already made an API object in your application, the next step is to create a service account and bind it to the API.

    Firstly, we go to the admin console and create a new basic user. Name it according to your API, so that it can clearly be recognized as a service account. For example, if my API is called APP API Perform Functionality, I might call my service account APP API Service Account

    Next, we add them to the Service Accounts group. To do this, go to /design/objects, filter by Group, and search for "Service Account". It'll look something like this:

    Open the group and add the new user you created. Make sure to also add your new service account to whatever group gives access to the API. You can figure out what group this would be by clicking on your web api and opening the Security page.

    Finally, we bind your service account to an api key. To do this, we go back to the admin console, and navigate to the Web API Authentication section.

    From there, we click Create a New API Key. You'll be prompted to enter your service account, and provide a description. Use the description to describe what this service account will be doing (i.e. the functionality of the API).

    Once you click create, you'll be prompted to copy your API key. DO NOT IGNORE THIS PAGE, instead, copy your api key and save it somewhere safe. Make sure to also communicate this to other members of your team, so that everyone that will have to do any development involving your API will be able to run tests themselves.

    At that point, you should be all set up! Definitely let me know if you have any follow up questions or if anything I've said didn't make much sense.

    Otherwise, good luck!

Children