You can use any SOAP client to invoke an API. We use the SOAP UI in this example.
See the following topics for a description of the concepts that you need to know when invoking an API:
The examples here use the PhoneVerification
API, which is created in section Create and Publish an API.
Let's invoke the PhoneVerification
API using a SOAP client.
- Log in to the API Store and click an API that you want to invoke (e.g.,
PhoneVerification
). - The API's Overview page opens. Select an application, the Bronze tier and subscribe to the API.
- Go to the My Subscriptions page and generate a production key to the default application using which you subscribed to the API.
- Copy the access token to the clipboard as you need it later to invoke the API.
- Download the SOAP UI installation that suits your operating system from http://www.soapui.org/ and open its console.
- In the SOAP UI, right click on the Projects menu and create a new SOAP project.
- Give your API's WSDL and click OK. In this case, the WSDL is http://ws.cdyne.com/phoneverify/phoneverify.asmx?wsdl.
- The WSDL defines two operations. Let's work with
CheckPhoneNumber
. Double click onRequest 1
. Then, add an authorization header to your request by clicking the add sign on the Header tab of the console.
Give the value of the Authorization header as 'Bearer <the access token you copied in step 5>.
Add the following values and submit the request:
Change the endpoint with the production URL of the API. You can copy the production URL from the API's Overview tab in the API Store. Append the resources to the end of the URL, if any. The resource is
/CheckPhoneNumber
for thePhoneVerification
API that we use here.In the SOAP request, change the parameters, which are PhoneNumber and LicenseKey. Let's give any dummy phone number and 0 as the license key
Note the result on the right-hand side panel. As you gave a dummy phone number in this example, you get the result as invalid.
You have invoked an API using a SOAP client.