Many web services use some kind of authentication method to secure access to the web service. There are a lot of authentication types available, one of which is the use of API Keys. This article will guide you through the process of setting up authentication based on API Keys for your Web Service. 


Fields


Query
All query parameters will be appended to the url in the following format:
https://www.example.com/api/endpoint?parameter=value

Template
All template parameters will be used to replace values in the url, like:
https://www.example.com/api/endpoint/{id}
Where the parameter name will be id and the entire {id} will be replaced with the parameter value when the web service request is being executed.

Headers
All header parameters will be appended to the Request Headers that are send along with your request.

Body
All body parameters will be appended to the request body of POST, PUT and DELETE Web Service calls. The body can be formatted either as JSON or FORM-URL-ENCODED.


Prerequisites


  • A web service that requires API Key based Authentication;


How To


  1. Go to https://design.appmachine.com and login;
  2. Select an existing app or create a new app;
  3. Click the "Add block" button;
  4. Select the "Pro" tab;
  5. Select the "Web Service" block and click "Add Block";
  6. Click "Custom Web Service";
  7. Enter the URL of your Web Service;
  8. Now you need to specify the API Key based Authentication. AppMachine uses (so called) Authorization Providers to specify any type of authentication that should be used during a Web Service call. To setup an API Key based Authentication we need to create a Custom Authentication Authorization Provider. Click the "+" button next to the Authorization provider field.
  9. The wizard will allow you to create a new Authorization Provider. First you will need to switch the Type to Custom;
  10. Give the Authorization Provider a recognizable name;

  11. Specify the parameters that we should send along with each web service using this authorization provider;
  12. Click "Finish";
  13. Select the Authorization Provider you've just created;
  14. Click "Go";
  15. We will perform a test call using the specified API Keys, and when successful you can finish the Web Service integration;