{"id":4175,"date":"2022-09-15T06:59:58","date_gmt":"2022-09-15T06:59:58","guid":{"rendered":"https:\/\/ccbill.com\/kb\/?p=4175"},"modified":"2023-10-04T13:15:20","modified_gmt":"2023-10-04T13:15:20","slug":"what-is-an-api-call","status":"publish","type":"post","link":"https:\/\/ccbill.com\/kb\/what-is-an-api-call","title":{"rendered":"What is an API Call?"},"content":{"rendered":"\n<p class=\"h3\">Introduction<\/p>\n\n\n\n<p>By allowing two applications to interact, <a href=\"https:\/\/ccbill.com\/kb\/what-is-an-api\" target=\"_blank\" rel=\"noreferrer noopener\">APIs<\/a> make activities such as browsing and shopping quick, effortless, and seamless. &nbsp;<\/p>\n\n\n\n<p>To use APIs successfully, developers and businesses need to know <a href=\"https:\/\/ccbill.com\/kb\/what-is-api-integration\" target=\"_blank\" rel=\"noreferrer noopener\">how to integrate with them<\/a>. Every API comes with API documentation outlining when and how an API is used. Such documentation often includes the term API call.<\/p>\n\n\n\n<p>Find out what API calls are and how to use them.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"400\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call.png\" alt=\"What is an API call?\" class=\"wp-image-4176\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call-300x150.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call-768x384.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">What is an API Call?<\/h2>\n\n\n\n<p>An API call (also called an API request) is how a client application and an <a href=\"https:\/\/ccbill.com\/kb\/what-is-an-api-endpoint\" target=\"_blank\" rel=\"noreferrer noopener\">API endpoint<\/a> (the point of access to a server or program) communicate.<\/p>\n\n\n\n<p>Every API call is initiated by the client application. The process consists of the following steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A client application submits a request to an API endpoint.<\/li>\n\n\n\n<li>The API endpoint passes the request to the API.<\/li>\n\n\n\n<li>The API performs the requested action.<\/li>\n\n\n\n<li>The API endpoint informs the client application about the outcome.<\/li>\n<\/ol>\n\n\n\n<p>API calls can be made using virtually any programming language as long as it is supported by the API.<\/p>\n\n\n\n<p>The two basic ways to make an API call are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>By requesting a URL in a <a href=\"https:\/\/phoenixnap.com\/glossary\/web-browser-definition\" target=\"_blank\" rel=\"noreferrer noopener\">web browser<\/a>.<\/li>\n\n\n\n<li>By performing a cURL request through a terminal.<\/li>\n<\/ul>\n\n\n\n<p>In both cases, APIs communicate with client applications using the HTTP protocol, meaning they utilize the five basic HTTP functions, which are:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>GET<\/strong> \u2013 Retrieve data.<\/li>\n\n\n\n<li><strong>POST<\/strong> \u2013 Create data.<\/li>\n\n\n\n<li><strong>PUT<\/strong> \u2013 Update existing data.<\/li>\n\n\n\n<li><strong>PATCH<\/strong> \u2013 Update a part of existing data.<\/li>\n\n\n\n<li><strong>DELETE<\/strong> \u2013 Delete data.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"321\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/api-call-http-methods.jpg\" alt=\"HTTP methods for API requests.\" class=\"wp-image-4177\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/api-call-http-methods.jpg 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/api-call-http-methods-300x120.jpg 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/api-call-http-methods-768x308.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>REST APIs return a value for all functions while SOAP APIs only respond to POST. However, API owners reserve the right to prevent the API from responding to certain types of requests.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">API Calls and Their Relationship with API Protocols<\/h3>\n\n\n\n<p>Modern day APIs are used to access, manage, and manipulate vast amounts of data, calling for more complex API calls.<\/p>\n\n\n\n<p>Complex API calls are achieved through established API-building protocols, patterns, and best practices. Some of the most popular API protocols are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/ccbill.com\/kb\/what-is-a-rest-api\" target=\"_blank\" rel=\"noreferrer noopener\">REST<\/a><\/li>\n\n\n\n<li>SOAP<\/li>\n\n\n\n<li>RPC<\/li>\n\n\n\n<li>GraphQL<\/li>\n\n\n\n<li><a href=\"https:\/\/ccbill.com\/kb\/what-is-a-webhook\" target=\"_blank\" rel=\"noreferrer noopener\">WebHooks<\/a><\/li>\n\n\n\n<li>WebSockets<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">How to Make an API Call<\/h2>\n\n\n\n<p>The structure of an API call depends on the <a href=\"https:\/\/ccbill.com\/kb\/types-of-api\" target=\"_blank\" rel=\"noreferrer noopener\">API type<\/a>, architectural style, and communication protocol. API providers maintain documentation that explains how to structure an API call and lists resource locations (URL endpoints) for their service.<\/p>\n\n\n\n<p>For example, RESTful API calls using the HTTP protocol consist of 5 elements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Verb<\/strong> \u2212 Identifies the HTTP request function (i.e., GET, POST, DELETE, PUT, PATCH).<\/li>\n\n\n\n<li><strong>URI (Uniform Resource Identifier)<\/strong> \u2212 The URI identifies the location of the resource on the server.<\/li>\n\n\n\n<li><strong>HTTP Version<\/strong> \u2212 Indicates the HTTP version (for example, <strong>v1<\/strong> or <strong>v2<\/strong>).<\/li>\n\n\n\n<li><strong>Request Headers<\/strong> \u2212 An HTTP header is a name-value pair that contains additional information about the resource or the client initiating the call. This includes authorization data, authentication methods, browser types, formats supported by the client, etc.<\/li>\n\n\n\n<li><strong>Request Body<\/strong> \u2212 The content (parameters) of the call message in the specified data format.<\/li>\n<\/ul>\n\n\n\n<p>The following steps illustrate what actions a client needs to take when making an API call.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Authentication and Authorization<\/h3>\n\n\n\n<p>API providers want to protect server resources by authenticating API calls before authorizing a request. Non-essential server resources are often protected using <a rel=\"noreferrer noopener\" href=\"https:\/\/ccbill.com\/kb\/curl-basic-auth\" target=\"_blank\">Basic Auth<\/a>; however, APIs that exchange sensitive customer information use bearer tokens and the <a href=\"https:\/\/ccbill.com\/kb\/what-is-oauth\" target=\"_blank\" rel=\"noreferrer noopener\">OAuth 2.0<\/a> standard to authenticate API calls.<\/p>\n\n\n\n<p>To authenticate API calls:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Clients need to register their applications with the API provider.<\/li>\n\n\n\n<li>The API provider awards each client a unique <a href=\"https:\/\/phoenixnap.com\/glossary\/secret-key\" target=\"_blank\" rel=\"noreferrer noopener\">secret key<\/a>.<\/li>\n\n\n\n<li>The client requests an access token by sending a structured API call containing the private key to the provider-designated endpoint.<\/li>\n\n\n\n<li>The client receives a randomly generated access token. An access token is a character string that grants a client application permission to call an API and access protected resources.<\/li>\n\n\n\n<li>Every time clients send an API call; they must provide the access token in the Header element.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Identify API Endpoints<\/h3>\n\n\n\n<p>Endpoint URLs tell API users where to send the API calls.<\/p>\n\n\n\n<p>API providers try to define and group endpoints to reflect the logical structure of server resources. Usually, an API service shares the same base URL, while the endpoint URI varies for each resource.<\/p>\n\n\n\n<p>For example, CCBill\u2019s RESTful Transaction API uses distinct endpoints for different actions a client can initiate with their API calls.<\/p>\n\n\n\n<p>The CCBill RESTful API base URL is <strong>https:\/\/api.ccbill.com<\/strong>.<\/p>\n\n\n\n<p>The endpoint URL for generating a payment token uses the <strong>\/payment-tokens<\/strong> resource:<\/p>\n\n\n\n<p><em><strong>https:\/\/api.ccbill.com\/payment-tokens\/merchant-only<\/strong><\/em><\/p>\n\n\n\n<p>If a merchant wants to verify the customer\u2019s identity before creating a payment token (by requesting a <a href=\"https:\/\/ccbill.com\/kb\/cvc-vs-cvv\" target=\"_blank\" rel=\"noreferrer noopener\">CVV2 code<\/a>), they need to use a different endpoint:<\/p>\n\n\n\n<p><em><strong>https:\/\/api.ccbill.com\/payment-tokens\/merchant-only-verify<\/strong><\/em><\/p>\n\n\n\n<p>The created token is then passed to a third endpoint in a transaction request:<\/p>\n\n\n\n<p><em><strong>https:\/\/api.ccbill.com\/transactions\/payment-tokens\/{payment_token_id}<\/strong><\/em><\/p>\n\n\n\n<p>This endpoint enables merchants to <a href=\"https:\/\/ccbill.com\/billing-solutions\" target=\"_blank\" rel=\"noreferrer noopener\">bill a customer<\/a>.<\/p>\n\n\n\n<p>Merchants need to identify which endpoint provides the services they need and follow the documentation to the letter for this process to be successful.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: API Call Header<\/h3>\n\n\n\n<p>An API header contains API call metadata like acceptable media types and authorization information. For example, CCBill requires merchants to provide their bearer token in the request header before authorizing an API request:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n$request = new HttpRequest();\n$request-&gt;setUrl(&#039;https:\/\/api.ccbill.com\/payment-tokens\/merchant-only-verify&#039;);\n$request-&gt;setMethod(HTTP_METH_POST);\n\/\/Headers begin here\n$request-&gt;setHeaders(array(\n&#039;Cache-Control&#039; =&gt; &#039;no-cache&#039;,\n&#039;Authorization&#039; =&gt; &#039;Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsibWNuLXRyYW5zYWN0aW9uLXNlcnZpY2UiLCJtY24tYWRtaW4tc2VydmljZSJdLCJzY29wZSI6WyJjcmVhdGVfdG9rZW4iLCJyZWFkX3Rva2VuIiwiY2hhcmdlX3Rva2VuIiwiY3JlYXRlX3Byb2dyYW0iLCJyZWFkX3Byb2dyYW0iLCJjcmVhdGVfcHJvZ3JhbV9wYXJ0aWNpcGF0aW9uIiwicmVhZF9wcm9ncmFtX3BhcnRpY2lwYXRpb24iLCJtb2RpZnlfcHJvZ3JhbV9wYXJ0aWNpcGF0aW9uIl0sImV4cCI6MTUzNzM4MDczNiwiYXV0aG9yaXRpZXMiOlsiTUNOX0FQSV9UT0tFTl9DSEFSR0VSIiwiTUNOX0FQSV9UT0tFTl9DUkVBVE9SIiwiTUNOX0FQSV9BRE1JTiJdLCJqdGkiOiI4YzI2Njg1MC00NjMzLTQzZDMtYjZjOC1lNzIyY2ExNjQ1YTUiLCJjbGllbnRfaWQiOiI1MjE3NjhhYTc1OGQxMWU4YWE2YjAwNTA1NjlkMTU4NSJ9.HRYXZFATkIcI2_LJ1W_xo67IfBnbN9atyYNzyHqseLxYUxzgwBsAV5rNqCixKemOrDIeQLBN4jrwRsBIHDpEvshwBC8XmTodDJzpGmMaU9s1r20RV68X0_d1yTgSDke_Of7VCrVmJRbSuDl7AgsfTqQ1J7nWyu9vcIaER93ms-vadser_Ot9Z68_HAmCJL3DCLpdIFq3PYtBMKKKqXbvhfhSZQZD3b6-aewAnBo0VzpvK6tREqw1rv9_73oAvYcW2aHAj79ILr8viWMM40LyDKMMYOYkneg3hJUQsUVeh9WzztYUJKzERYNXje9fYIGN-eofoLvX7OZJ3eXmIfkrfQ&#039;,\n&#039;Content-Type&#039; =&gt; &#039;application\/json&#039;\n));\n\/\/ Headers end here\n$request-&gt;setBody(&#039;{ &quot;clientAccnum&quot;: 900000, &quot;clientSubacc&quot;: 0, &quot;customerInfo&quot;: { &quot;customerFname&quot;: &quot;Tyler&quot;, &quot;customerLname&quot;: &quot;Thomas&quot;, &quot;address1&quot;: &quot;Woodland Drive&quot;, &quot;address2&quot;: &quot;Apt 21&quot;, &quot;city&quot;: &quot;Tempe&quot;, &quot;state&quot;: &quot;AZ&quot;, &quot;zipcode&quot;: &quot;85281&quot;, &quot;country&quot;: &quot;US&quot;, &quot;phoneNumber&quot;: &quot;5555555555&quot;, &quot;email&quot;: &quot;tthomas@xyz.com&quot;, &quot;ipAddress&quot;: &quot;10.70.60.14&quot;, &quot;browserHttpUserAgent&quot;: &quot;Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko\/20100101 Firefox\/60.0&quot;, &quot;browserHttpAccept&quot;: &quot;text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8&quot;, &quot;browserHttpAcceptLanguage&quot;: &quot;en-US,en;q=0.5&quot;, &quot;browserHttpAcceptEncoding&quot;: &quot;gzip, deflate, br&quot; }, &quot;paymentInfo&quot;: { &quot;creditCardPaymentInfo&quot;: { &quot;cardNum&quot;: &quot;4473707989493598&quot;, &quot;nameOnCard&quot;: &quot;Tyler Thomas&quot;, &quot;expMonth&quot;: &quot;04&quot;, &quot;expYear&quot;: &quot;2019&quot;, &quot;cvv2&quot;: &quot;123&quot; } }, &quot;subscriptionId&quot;:900000000000000001, &quot;timeToLive&quot;: 30, &quot;validNumberOfUse&quot;: 3 }&#039;);\ntry {\n$response = $request-&gt;send();\necho $response-&gt;getBody();\n} catch (HttpException $ex) {\necho $ex;\n}\n?&gt;<\/code><\/pre>\n\n\n\n<p>The header array in this PHP example prevents client-side caching. It also requires objects to follow the JSON (JavaScript Object Notation) open-standard file format and use the <strong>application\/json<\/strong> content type.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: API Call Parameters<\/h3>\n\n\n\n<p>The body of an API call contains a set of parameters and their corresponding values. The API documentation must list every parameter for each endpoint. It should also provide parameter descriptions, what data types are acceptable, and emphasize if a parameter is required or optional.<\/p>\n\n\n\n<p>Let\u2019s explore parameters and their values using the same API call example as above:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n$request = new HttpRequest();\n$request-&gt;setUrl(&#039;https:\/\/api.ccbill.com\/payment-tokens\/merchant-only-verify&#039;);\n$request-&gt;setMethod(HTTP_METH_POST);\n$request-&gt;setHeaders(array(\n&#039;Cache-Control&#039; =&gt; &#039;no-cache&#039;,\n&#039;Authorization&#039; =&gt; &#039;Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsibWNuLXRyYW5zYWN0aW9uLXNlcnZpY2UiLCJtY24tYWRtaW4tc2VydmljZSJdLCJzY29wZSI6WyJjcmVhdGVfdG9rZW4iLCJyZWFkX3Rva2VuIiwiY2hhcmdlX3Rva2VuIiwiY3JlYXRlX3Byb2dyYW0iLCJyZWFkX3Byb2dyYW0iLCJjcmVhdGVfcHJvZ3JhbV9wYXJ0aWNpcGF0aW9uIiwicmVhZF9wcm9ncmFtX3BhcnRpY2lwYXRpb24iLCJtb2RpZnlfcHJvZ3JhbV9wYXJ0aWNpcGF0aW9uIl0sImV4cCI6MTUzNzM4MDczNiwiYXV0aG9yaXRpZXMiOlsiTUNOX0FQSV9UT0tFTl9DSEFSR0VSIiwiTUNOX0FQSV9UT0tFTl9DUkVBVE9SIiwiTUNOX0FQSV9BRE1JTiJdLCJqdGkiOiI4YzI2Njg1MC00NjMzLTQzZDMtYjZjOC1lNzIyY2ExNjQ1YTUiLCJjbGllbnRfaWQiOiI1MjE3NjhhYTc1OGQxMWU4YWE2YjAwNTA1NjlkMTU4NSJ9.HRYXZFATkIcI2_LJ1W_xo67IfBnbN9atyYNzyHqseLxYUxzgwBsAV5rNqCixKemOrDIeQLBN4jrwRsBIHDpEvshwBC8XmTodDJzpGmMaU9s1r20RV68X0_d1yTgSDke_Of7VCrVmJRbSuDl7AgsfTqQ1J7nWyu9vcIaER93ms-vadser_Ot9Z68_HAmCJL3DCLpdIFq3PYtBMKKKqXbvhfhSZQZD3b6-aewAnBo0VzpvK6tREqw1rv9_73oAvYcW2aHAj79ILr8viWMM40LyDKMMYOYkneg3hJUQsUVeh9WzztYUJKzERYNXje9fYIGN-eofoLvX7OZJ3eXmIfkrfQ&#039;,\n&#039;Content-Type&#039; =&gt; &#039;application\/json&#039;\n));\n\/\/ Parameters begin here\n$request-&gt;setBody(&#039;{ &quot;clientAccnum&quot;: 900000, &quot;clientSubacc&quot;: 0, &quot;customerInfo&quot;: { &quot;customerFname&quot;: &quot;Tyler&quot;, &quot;customerLname&quot;: &quot;Thomas&quot;, &quot;address1&quot;: &quot;Woodland Drive&quot;, &quot;address2&quot;: &quot;Apt 21&quot;, &quot;city&quot;: &quot;Tempe&quot;, &quot;state&quot;: &quot;AZ&quot;, &quot;zipcode&quot;: &quot;85281&quot;, &quot;country&quot;: &quot;US&quot;, &quot;phoneNumber&quot;: &quot;5555555555&quot;, &quot;email&quot;: &quot;tthomas@xyz.com&quot;, &quot;ipAddress&quot;: &quot;10.70.60.14&quot;, &quot;browserHttpUserAgent&quot;: &quot;Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko\/20100101 Firefox\/60.0&quot;, &quot;browserHttpAccept&quot;: &quot;text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8&quot;, &quot;browserHttpAcceptLanguage&quot;: &quot;en-US,en;q=0.5&quot;, &quot;browserHttpAcceptEncoding&quot;: &quot;gzip, deflate, br&quot; }, &quot;paymentInfo&quot;: { &quot;creditCardPaymentInfo&quot;: { &quot;cardNum&quot;: &quot;4473707989493598&quot;, &quot;nameOnCard&quot;: &quot;Tyler Thomas&quot;, &quot;expMonth&quot;: &quot;04&quot;, &quot;expYear&quot;: &quot;2019&quot;, &quot;cvv2&quot;: &quot;123&quot; } }, &quot;subscriptionId&quot;:900000000000000001, &quot;timeToLive&quot;: 30, &quot;validNumberOfUse&quot;: 3 }&#039;);\n\/\/ Parameters end here\ntry {\n$response = $request-&gt;send();\necho $response-&gt;getBody();\n} catch (HttpException $ex) {\necho $ex;\n}\n?&gt;<\/code><\/pre>\n\n\n\n<p>CCBill\u2019s system verifies the request and uses the provided customer information to create a payment token.<\/p>\n\n\n\n<p>Before adding parameters to a call, always consult the appropriate API documentation for instructions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: API Server Response<\/h3>\n\n\n\n<p>The API server responds by sending structured parameters and their corresponding values based on the API request. A common component of API server responses are <strong>HTTP status codes.<\/strong> HTTP codes confirm if a request was successful or inform API clients that a request failed.<\/p>\n\n\n\n<p>For example, successfully creating a payment token using CCBill\u2019s RESTful API returns a 200 HTTP code and the following parameters:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ &quot;createdDatetime&quot;: &quot;datetime-only&quot;, &quot;timeToLive&quot;: &quot;integer&quot;, &quot;originalPaymentTokenId&quot;: &quot;string&quot;, &quot;validNumberOfUse&quot;: &quot;integer&quot;, &quot;clientAccnum&quot;: &quot;integer&quot;, &quot;clientSubacc&quot;: &quot;integer&quot;, &quot;programParticipationId&quot;: &quot;integer&quot;, &quot;avsResponse&quot;: &quot;string&quot;, &quot;paymentTokenId&quot;: &quot;string&quot;, &quot;paymentInfoId&quot;: &quot;string&quot;, &quot;cvv2Response&quot;: &quot;string&quot;, &quot;subscriptionId&quot;: &quot;integer&quot; }<\/code><\/pre>\n\n\n\n<p>Merchants can extract the <em>paymentTokenID<\/em> string and make a new API call to charge the customer.<\/p>\n\n\n\n<p>Unsuccessful API calls always return a status code, upon which the user or client can determine what went wrong.<\/p>\n\n\n\n<p>Here are some of the most used HTTP status codes and their meanings.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1xx Codes<\/h4>\n\n\n\n<p>1xx HTTP codes are temporary status codes that inform the client that their request has been received and waiting to be processed.<\/p>\n\n\n\n<p>The following table explains some of the most used 1xx codes:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><thead><tr><th>Code<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td>100 Continue<\/td><td>The server understood the initial part of the request. The client can proceed with the request or ignore this response if they completed their task.<\/td><\/tr><tr><td>101 Switching Protocols<\/td><td>The server understands the Upgrade header and informs the client about the protocol it is switching to.<\/td><\/tr><tr><td>102 Processing<\/td><td>The server has accepted the request but has not completed it yet.<\/td><\/tr><tr><td>103 Early Hints<\/td><td>The client can preload some resources while waiting for a request response.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2xx Codes<\/h4>\n\n\n\n<p>2xx codes inform the client that their request has been successful, sometimes with additional context.<\/p>\n\n\n\n<p>The following table provides details about the most used 2xx codes:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><thead><tr><th>Code<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td>200 OK<\/td><td>The request was completed successfully.<\/td><\/tr><tr><td>201 Created<\/td><td>The resource has been created successfully (for POST requests).<\/td><\/tr><tr><td>202 Accepted<\/td><td>The request has been received but has not finished processing.<\/td><\/tr><tr><td>204 No Content<\/td><td>The request has been processed successfully but no content will be returned as a response.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">3xx Codes<\/h4>\n\n\n\n<p>3xx codes inform the client that they must take additional action <a>for<\/a> their request to be completed.<\/p>\n\n\n\n<p>The most used 3xx codes are as follows:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><thead><tr><th>Code<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td>300 Multiple Choices<\/td><td>The request has more than one response and the user must choose one.<\/td><\/tr><tr><td>301 Moved Permanently<\/td><td>The URL of the requested resource has been changed permanently. This response is followed by a Location header field containing the correct URL to address.<\/td><\/tr><tr><td>302 Found<\/td><td>The URL of the requested resource has been changed temporarily. This response is followed by a Location header field containing the correct URL to address.<\/td><\/tr><tr><td>303 See Other<\/td><td>The requested resource is found under another URI. The user should send a request using the GET method to the correct URI.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4xx Codes<\/h4>\n\n\n\n<p>4xx codes indicate an error on the client side of the request.<\/p>\n\n\n\n<p>The most used 4xx codes are as follows:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><thead><tr><th>Code<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td>400 Bad Request<\/td><td>The server does not understand the request due to incorrect syntax. The client must modify the request to proceed.<\/td><\/tr><tr><td>401 Unauthorized<\/td><td>The client\u2019s identity is unknown to the server. The request requires user authentication credentials to complete.<\/td><\/tr><tr><td>403 Forbidden<\/td><td>The client\u2019s identity is known to the server, but access is not granted.<\/td><\/tr><tr><td>404 Not Found<\/td><td>The requested resource cannot be found.<\/td><\/tr><tr><td>405 Method Not Allowed<\/td><td>The server recognizes the HTTP method, but it is disabled for use on the requested resource.<\/td><\/tr><tr><td>408 Request Timeout<\/td><td>The client failed to send a complete request within the server\u2019s allotted timeout period.<\/td><\/tr><tr><td>410 Gone<\/td><td>The requested resource is no longer available on that server.<\/td><\/tr><tr><td>429 Too Many Requests<\/td><td>The client has sent too many requests within a time frame.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5xx Codes<\/h4>\n\n\n\n<p>5xx codes indicate a server-side error.<\/p>\n\n\n\n<p>The following table explains some of the most used 5xx codes:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><thead><tr><th>Code<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td>500 Internal Server Error<\/td><td>The server is prevented from completing a request due to an unexpected issue.<\/td><\/tr><tr><td>501 Not Implemented<\/td><td>The HTTP method used in the request is not supported and cannot be handled by the server.<\/td><\/tr><tr><td>502 Bad Gateway<\/td><td>The server got an invalid response.<\/td><\/tr><tr><td>503 Service Unavailable<\/td><td>The server cannot handle the request.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Unique Status Codes<\/h4>\n\n\n\n<p>Besides HTTP status codes, servers may be configured to send unique response codes. Information about unique response codes can be found in the documentation provided by the API provider.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CCBill RESTful Transaction API Calls<\/h2>\n\n\n\n<p>CCBill\u2019s RESTful payment API enables merchants to manage transactions using API calls.<\/p>\n\n\n\n<p>A merchant needs to make several API requests for CCBill to capture payment information and charge a customer\u2019s payment card.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Generate Bearer Token<\/h3>\n\n\n\n<p>The CCBill RESTful Transaction API uses <a href=\"https:\/\/ccbill.com\/kb\/authorization-bearer\" target=\"_blank\" rel=\"noreferrer noopener\">bearer token-based authentication<\/a> and authorization. Before accessing the API, merchants must register their application with CCBill and receive a merchant application ID and secret key.<\/p>\n\n\n\n<p>Merchants provide these credentials to an authorization server to generate a bearer token.<\/p>\n\n\n\n<p><strong>Endpoint URL<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>https:\/\/api.ccbill.com\/ccbill-auth\/oauth\/token<\/li>\n<\/ul>\n\n\n\n<p><strong>Header<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Content-Type: application\/x-www-form-urlencoded<\/strong><\/li>\n\n\n\n<li><strong>Authorization: Basic Merchant_ApplicationID:Merchant_Secret<\/strong><\/li>\n<\/ul>\n\n\n\n<p><strong>Example Request<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl - POST &#039;https:\/\/api.ccbill.com\/ccbill-auth\/oauth\/token&#039; \\\n--header &#039;Content-Type: application\/x-www-form-urlencoded&#039; \\\n--header &#039;Authorization: Basic Merchant_ApplicationID:Merchant_Secret &#039; \\\n--data-urlencode &#039;grant_type=client_credentials&#039;<\/code><\/pre>\n\n\n\n<p>The result of this request is a unique data string (bearer token) that must be provided in the authorization header of each API request.<\/p>\n\n\n\n<p>Merchant applications have access until the access token expires or is revoked.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Create Payment Token ID<\/h3>\n\n\n\n<p>Merchants can use their newly created bearer token to generate a payment token ID based on the customer\u2019s payment data.<\/p>\n\n\n\n<p>The endpoint for creating a payment token ID is:<\/p>\n\n\n\n<p>https:\/\/api.ccbill.com\/payment-tokens\/merchant-only<\/p>\n\n\n\n<p>An example API call contains the following header and parameters:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n$request = new HttpRequest();\n$request-&gt;setUrl(&#039;https:\/\/api.ccbill.com\/payment-tokens\/merchant-only&#039;);\n$request-&gt;setMethod(HTTP_METH_POST);\n$request-&gt;setHeaders(array(\n&#039;Cache-Control&#039; =&gt; &#039;no-cache&#039;,\n&#039;Authorization&#039; =&gt; &#039;Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsibWNuLXRyYW5zYWN0aW9uLXNlcnZpY2UiLCJtY24tYWRtaW4tc2VydmljZSJdLCJzY29wZSI6WyJjcmVhdGVfdG9rZW4iLCJyZWFkX3Rva2VuIiwiY2hhcmdlX3Rva2VuIiwiY3JlYXRlX3Byb2dyYW0iLCJyZWFkX3Byb2dyYW0iLCJjcmVhdGVfcHJvZ3JhbV9wYXJ0aWNpcGF0aW9uIiwicmVhZF9wcm9ncmFtX3BhcnRpY2lwYXRpb24iLCJtb2RpZnlfcHJvZ3JhbV9wYXJ0aWNpcGF0aW9uIl0sImV4cCI6MTUzNzM4MDczNiwiYXV0aG9yaXRpZXMiOlsiTUNOX0FQSV9UT0tFTl9DSEFSR0VSIiwiTUNOX0FQSV9UT0tFTl9DUkVBVE9SIiwiTUNOX0FQSV9BRE1JTiJdLCJqdGkiOiI4YzI2Njg1MC00NjMzLTQzZDMtYjZjOC1lNzIyY2ExNjQ1YTUiLCJjbGllbnRfaWQiOiI1MjE3NjhhYTc1OGQxMWU4YWE2YjAwNTA1NjlkMTU4NSJ9.HRYXZFATkIcI2_LJ1W_xo67IfBnbN9atyYNzyHqseLxYUxzgwBsAV5rNqCixKemOrDIeQLBN4jrwRsBIHDpEvshwBC8XmTodDJzpGmMaU9s1r20RV68X0_d1yTgSDke_Of7VCrVmJRbSuDl7AgsfTqQ1J7nWyu9vcIaER93ms-vadser_Ot9Z68_HAmCJL3DCLpdIFq3PYtBMKKKqXbvhfhSZQZD3b6-aewAnBo0VzpvK6tREqw1rv9_73oAvYcW2aHAj79ILr8viWMM40LyDKMMYOYkneg3hJUQsUVeh9WzztYUJKzERYNXje9fYIGN-eofoLvX7OZJ3eXmIfkrfQ&#039;,\n&#039;Content-Type&#039; =&gt; &#039;application\/json&#039;\n));\n$request-&gt;setBody(&#039;{ &quot;clientAccnum&quot;: 900000, &quot;clientSubacc&quot;: 0, &quot;customerInfo&quot;: { &quot;customerFname&quot;: &quot;Tyler&quot;, &quot;customerLname&quot;: &quot;Thomas&quot;, &quot;address1&quot;: &quot;Woodland Drive&quot;, &quot;address2&quot;: &quot;Apt 21&quot;, &quot;city&quot;: &quot;Tempe&quot;, &quot;state&quot;: &quot;AZ&quot;, &quot;zipcode&quot;: &quot;85281&quot;, &quot;country&quot;: &quot;US&quot;, &quot;phoneNumber&quot;: &quot;5555555555&quot;, &quot;email&quot;: &quot;tthomas@xyz.com&quot;, &quot;ipAddress&quot;: &quot;10.70.60.14&quot;, &quot;browserHttpUserAgent&quot;: &quot;Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko\/20100101 Firefox\/60.0&quot;, &quot;browserHttpAccept&quot;: &quot;text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8&quot;, &quot;browserHttpAcceptLanguage&quot;: &quot;en-US,en;q=0.5&quot;, &quot;browserHttpAcceptEncoding&quot;: &quot;gzip, deflate, br&quot; }, &quot;paymentInfo&quot;: { &quot;creditCardPaymentInfo&quot;: { &quot;cardNum&quot;: &quot;4473707989493598&quot;, &quot;nameOnCard&quot;: &quot;Tyler Thomas&quot;, &quot;expMonth&quot;: &quot;04&quot;, &quot;expYear&quot;: &quot;2019&quot; } }, &quot;subscriptionId&quot;:900000000000000001, &quot;timeToLive&quot;: 30, &quot;validNumberOfUse&quot;: 3 }&#039;);\ntry {\n$response = $request-&gt;send();\necho $response-&gt;getBody();\n} catch (HttpException $ex) {\necho $ex;\n}\n?&gt;<\/code><\/pre>\n\n\n\n<p>CCBill has also created an <a href=\"https:\/\/github.com\/CCBill\/restful-api-guide\/blob\/main\/README.md#how-to-integrate-with-the-ccbill-advanced-widget\" target=\"_blank\" rel=\"noreferrer noopener\">Advanced Widget<\/a> library that helps merchants automate payment token requests. Merchants can design their interface to call the widget and generate payment tokens.<\/p>\n\n\n\n<p>The JavaScript widget is hosted in a location accessible to merchants allowing them to reference and import the widget into their websites.<\/p>\n\n\n\n<p>The primary function of the Advanced Widget is <strong>createPaymentToken<\/strong>. This function either returns a created payment token output or an error message if the payment token cannot be created with the provided inputs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Charge Payment Token ID<\/h3>\n\n\n\n<p>The API call to charge a customer needs to contain the bearer token in the request header and the payment token ID in the request body.<\/p>\n\n\n\n<p>The HTTP request URL for charging a customer (without <a href=\"https:\/\/ccbill.com\/kb\/strong-customer-authentication\" target=\"_blank\" rel=\"noreferrer noopener\">3DS Authentication<\/a>) is:<\/p>\n\n\n\n<p>https:\/\/api.ccbill.com\/transactions\/payment-tokens\/{payment_token_id}<\/p>\n\n\n\n<p>Merchants need to supply the payment token ID as a <strong>URI parameter<\/strong>.<\/p>\n\n\n\n<p>An example API call for charging a customer payment token contains the following parameters:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n$request = new HttpRequest();\n$request-&gt;setUrl(&#039;https:\/\/api.ccbill.com\/transactions\/payment-tokens\/01047ed6f3b440c7a2ccc6abc1ad0a84&#039;);\n$request-&gt;setMethod(HTTP_METH_POST);\n$request-&gt;setHeaders(array(\n&#039;Cache-Control&#039; =&gt; &#039;no-cache&#039;,\n&#039;Authorization&#039; =&gt; &#039;Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsibWNuLXRyYW5zYWN0aW9uLXNlcnZpY2UiLCJtY24tYWRtaW4tc2VydmljZSJdLCJzY29wZSI6WyJjcmVhdGVfdG9rZW4iLCJyZWFkX3Rva2VuIiwiY2hhcmdlX3Rva2VuIiwiY3JlYXRlX3Byb2dyYW0iLCJyZWFkX3Byb2dyYW0iLCJjcmVhdGVfcHJvZ3JhbV9wYXJ0aWNpcGF0aW9uIiwicmVhZF9wcm9ncmFtX3BhcnRpY2lwYXRpb24iLCJtb2RpZnlfcHJvZ3JhbV9wYXJ0aWNpcGF0aW9uIl0sImV4cCI6MTUzNzM4MDczNiwiYXV0aG9yaXRpZXMiOlsiTUNOX0FQSV9UT0tFTl9DSEFSR0VSIiwiTUNOX0FQSV9UT0tFTl9DUkVBVE9SIiwiTUNOX0FQSV9BRE1JTiJdLCJqdGkiOiI4YzI2Njg1MC00NjMzLTQzZDMtYjZjOC1lNzIyY2ExNjQ1YTUiLCJjbGllbnRfaWQiOiI1MjE3NjhhYTc1OGQxMWU4YWE2YjAwNTA1NjlkMTU4NSJ9.HRYXZFATkIcI2_LJ1W_xo67IfBnbN9atyYNzyHqseLxYUxzgwBsAV5rNqCixKemOrDIeQLBN4jrwRsBIHDpEvshwBC8XmTodDJzpGmMaU9s1r20RV68X0_d1yTgSDke_Of7VCrVmJRbSuDl7AgsfTqQ1J7nWyu9vcIaER93ms-vadser_Ot9Z68_HAmCJL3DCLpdIFq3PYtBMKKKqXbvhfhSZQZD3b6-aewAnBo0VzpvK6tREqw1rv9_73oAvYcW2aHAj79ILr8viWMM40LyDKMMYOYkneg3hJUQsUVeh9WzztYUJKzERYNXje9fYIGN-eofoLvX7OZJ3eXmIfkrfQ&#039;,\n&#039;Content-Type&#039; =&gt; &#039;application\/json&#039;\n));\n$request-&gt;setBody(&#039;{ &quot;clientAccnum&quot;:900123, &quot;clientSubacc&quot;:10, &quot;initialPrice&quot;: 9.99, &quot;initialPeriod&quot;: 10, &quot;recurringPrice&quot;: 15.00, &quot;recurringPeriod&quot;: 30, &quot;rebills&quot;: 99, &quot;currencyCode&quot;: 840, &quot;lifeTimeSubscription&quot;: false, &quot;createNewPaymentToken&quot;: false, &quot;passThroughInfo&quot;: &#091; { &quot;name&quot;: &quot;val1&quot;, &quot;value&quot;: &quot;val2&quot; } ] }&#039;);\ntry {\n$response = $request-&gt;send();\necho $response-&gt;getBody();\n} catch (HttpException $ex) {\necho $ex;\n}\n?&gt;<\/code><\/pre>\n\n\n\n<p>The charge also triggers a <a rel=\"noreferrer noopener\" href=\"https:\/\/ccbill.com\/doc\/webhooks-user-guide\" target=\"_blank\">webhook HTTP POST notification<\/a>, allowing the merchant to capture transaction information.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Read Payment Token ID<\/h3>\n\n\n\n<p>Merchants can obtain data about a payment token by sending its ID to the following API endpoint:<\/p>\n\n\n\n<p>https:\/\/api.ccbill.com\/transactions\/payment-tokens\/{paymentTokenId}<\/p>\n\n\n\n<p>The payment token ID is supplied as a <strong>URI parameter<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n$request = new HttpRequest();\n$request-&gt;setUrl(&#039;https:\/\/api.ccbill.com\/payment-tokens\/01047ed6f3b440c7a2ccc6abc1ad0a84&#039;);\n$request-&gt;setMethod(HTTP_METH_GET);\n$request-&gt;setHeaders(array(\n&#039;Cache-Control&#039; =&gt; &#039;no-cache&#039;,\n&#039;Authorization&#039; =&gt; &#039;Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsibWNuLXRyYW5zYWN0aW9uLXNlcnZpY2UiLCJtY24tYWRtaW4tc2VydmljZSJdLCJzY29wZSI6WyJjcmVhdGVfdG9rZW4iLCJyZWFkX3Rva2VuIiwiY2hhcmdlX3Rva2VuIiwiY3JlYXRlX3Byb2dyYW0iLCJyZWFkX3Byb2dyYW0iLCJyZWFkX3Byb2dyYW1fcGFydGljaXBhdGlvbiIsIm1vZGlmeV9wcm9ncmFtX3BhcnRpY2lwYXRpb24iXSwiZXhwIjoxNTM2MjcwMTE2LCJhdXRob3JpdGllcyI6WyJNQ05fQVBJX1RPS0VOX0NIQVJHRVIiLCJNQ05fQVBJX1RPS0VOX0NSRUFUT1IiLCJNQ05fQVBJX0FETUlOIl0sImp0aSI6IjlkZjQ5M2NjLTNmNDAtNDdmYS04ZjIwLWFiYWM5NTljOWFjYyIsImNsaWVudF9pZCI6IjUyMTc2OGFhNzU4ZDExZThhYTZiMDA1MDU2OWQxNTg1In0.e6pUqftnUlJcaz1rsxsoCBcitPvnAwAwp1ZiBl77ht0dsVRBUg3vOvruGzxELjVPKWFnu8NFXEJKEhoQXkZuqn2AiiM1u9mOJUtyQ9c1KgEMq6yTCQ_QIxGsrYcwkkr_B2yw5p_q6KHCcaAAAq4HGkKdHbo8C1GHvApD0Q7DVWRmie265Da6ln4Y1_wFHADKYTktCtLhBr4rv-5bmWHy25GKPZgIHViMrJmwSKqG2kC60JEYDrOsZsajhicbKPytXDw9X0Z6PcYPyRCkpz5I1FjsXJmIJnSKLwG8fPC2AOYPqF4p30BHLaCxvtS29jSbpfZj1W0pt708ipZSOlwHAw&#039;\n));\ntry {\n$response = $request-&gt;send();\necho $response-&gt;getBody();\n} catch (HttpException $ex) {\necho $ex;\n}\n?&gt;<\/code><\/pre>\n\n\n\n<p class=\"h3\">Conclusion<\/p>\n\n\n\n<p>You know what API calls are and how they work. The goal of the information provided is to clarify the concept of APIs and API calls as well as allow for an easier understanding of API documentation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide reveals what an API call is, how it works, and how to make one by analyzing examples from the CCBill API documentation.<\/p>\n","protected":false},"author":13,"featured_media":4176,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[13,14],"tags":[],"class_list":["post-4175","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-payment-processing","category-web-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is an API Call? {Definition &amp; Examples} | CCBill KB<\/title>\n<meta name=\"description\" content=\"Explore analyzed examples from CCBill&#039;s API documentation to find out what an API call is, how it works, and how to make one.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ccbill.com\/kb\/what-is-an-api-call\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is an API Call? {Definition &amp; Examples} | CCBill KB\" \/>\n<meta property=\"og:description\" content=\"Explore analyzed examples from CCBill&#039;s API documentation to find out what an API call is, how it works, and how to make one.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ccbill.com\/kb\/what-is-an-api-call\" \/>\n<meta property=\"og:site_name\" content=\"CCBill Knowledge Base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ccbillBIZ\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-15T06:59:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-04T13:15:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mirjana Tosic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CCBillBIZ\" \/>\n<meta name=\"twitter:site\" content=\"@CCBillBIZ\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mirjana Tosic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ccbill.com\/kb\/what-is-an-api-call#article\",\"isPartOf\":{\"@id\":\"https:\/\/ccbill.com\/kb\/what-is-an-api-call\"},\"author\":{\"name\":\"Mirjana Tosic\",\"@id\":\"https:\/\/ccbill.com\/kb\/#\/schema\/person\/aafe23f5acc151902c3d0955500581dc\"},\"headline\":\"What is an API Call?\",\"datePublished\":\"2022-09-15T06:59:58+00:00\",\"dateModified\":\"2023-10-04T13:15:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ccbill.com\/kb\/what-is-an-api-call\"},\"wordCount\":2091,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ccbill.com\/kb\/#organization\"},\"image\":{\"@id\":\"https:\/\/ccbill.com\/kb\/what-is-an-api-call#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call.png\",\"articleSection\":[\"Payment Processing\",\"Web Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ccbill.com\/kb\/what-is-an-api-call#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ccbill.com\/kb\/what-is-an-api-call\",\"url\":\"https:\/\/ccbill.com\/kb\/what-is-an-api-call\",\"name\":\"What is an API Call? {Definition & Examples} | CCBill KB\",\"isPartOf\":{\"@id\":\"https:\/\/ccbill.com\/kb\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ccbill.com\/kb\/what-is-an-api-call#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ccbill.com\/kb\/what-is-an-api-call#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call.png\",\"datePublished\":\"2022-09-15T06:59:58+00:00\",\"dateModified\":\"2023-10-04T13:15:20+00:00\",\"description\":\"Explore analyzed examples from CCBill's API documentation to find out what an API call is, how it works, and how to make one.\",\"breadcrumb\":{\"@id\":\"https:\/\/ccbill.com\/kb\/what-is-an-api-call#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ccbill.com\/kb\/what-is-an-api-call\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ccbill.com\/kb\/what-is-an-api-call#primaryimage\",\"url\":\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call.png\",\"contentUrl\":\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call.png\",\"width\":800,\"height\":400,\"caption\":\"What is an API call?\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ccbill.com\/kb\/what-is-an-api-call#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"KB Home\",\"item\":\"https:\/\/ccbill.com\/kb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Development\",\"item\":\"https:\/\/ccbill.com\/kb\/category\/web-development\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"What is an API Call?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ccbill.com\/kb\/#website\",\"url\":\"https:\/\/ccbill.com\/kb\/\",\"name\":\"CCBill Knowledge Base\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/ccbill.com\/kb\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ccbill.com\/kb\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ccbill.com\/kb\/#organization\",\"name\":\"CCBill\",\"url\":\"https:\/\/ccbill.com\/kb\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ccbill.com\/kb\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2020\/10\/ccbill-logo.png\",\"contentUrl\":\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2020\/10\/ccbill-logo.png\",\"width\":160,\"height\":70,\"caption\":\"CCBill\"},\"image\":{\"@id\":\"https:\/\/ccbill.com\/kb\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ccbillBIZ\/\",\"https:\/\/x.com\/CCBillBIZ\",\"https:\/\/www.linkedin.com\/company\/ccbill\",\"https:\/\/www.youtube.com\/c\/CCBillBiz\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ccbill.com\/kb\/#\/schema\/person\/aafe23f5acc151902c3d0955500581dc\",\"name\":\"Mirjana Tosic\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ccbill.com\/kb\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8ee0e92286c77cd8bcc10b1a3ae2090ca031b41c53f0b1e803e6b69e4bea8409?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8ee0e92286c77cd8bcc10b1a3ae2090ca031b41c53f0b1e803e6b69e4bea8409?s=96&d=mm&r=g\",\"caption\":\"Mirjana Tosic\"},\"description\":\"Mirjana Tosic is a Technical Writer with a background in Web Design and Development. Despite being one of the youngest members of CCBill, her writing skills and technical aptitude help her produce factual, informative, and user-friendly content. If not writing or learning a new skill, you'll find her binging fintech and marketing videos or gaming.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is an API Call? {Definition & Examples} | CCBill KB","description":"Explore analyzed examples from CCBill's API documentation to find out what an API call is, how it works, and how to make one.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ccbill.com\/kb\/what-is-an-api-call","og_locale":"en_US","og_type":"article","og_title":"What is an API Call? {Definition & Examples} | CCBill KB","og_description":"Explore analyzed examples from CCBill's API documentation to find out what an API call is, how it works, and how to make one.","og_url":"https:\/\/ccbill.com\/kb\/what-is-an-api-call","og_site_name":"CCBill Knowledge Base","article_publisher":"https:\/\/www.facebook.com\/ccbillBIZ\/","article_published_time":"2022-09-15T06:59:58+00:00","article_modified_time":"2023-10-04T13:15:20+00:00","og_image":[{"width":800,"height":400,"url":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call.png","type":"image\/png"}],"author":"Mirjana Tosic","twitter_card":"summary_large_image","twitter_creator":"@CCBillBIZ","twitter_site":"@CCBillBIZ","twitter_misc":{"Written by":"Mirjana Tosic","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ccbill.com\/kb\/what-is-an-api-call#article","isPartOf":{"@id":"https:\/\/ccbill.com\/kb\/what-is-an-api-call"},"author":{"name":"Mirjana Tosic","@id":"https:\/\/ccbill.com\/kb\/#\/schema\/person\/aafe23f5acc151902c3d0955500581dc"},"headline":"What is an API Call?","datePublished":"2022-09-15T06:59:58+00:00","dateModified":"2023-10-04T13:15:20+00:00","mainEntityOfPage":{"@id":"https:\/\/ccbill.com\/kb\/what-is-an-api-call"},"wordCount":2091,"commentCount":0,"publisher":{"@id":"https:\/\/ccbill.com\/kb\/#organization"},"image":{"@id":"https:\/\/ccbill.com\/kb\/what-is-an-api-call#primaryimage"},"thumbnailUrl":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call.png","articleSection":["Payment Processing","Web Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ccbill.com\/kb\/what-is-an-api-call#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ccbill.com\/kb\/what-is-an-api-call","url":"https:\/\/ccbill.com\/kb\/what-is-an-api-call","name":"What is an API Call? {Definition & Examples} | CCBill KB","isPartOf":{"@id":"https:\/\/ccbill.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ccbill.com\/kb\/what-is-an-api-call#primaryimage"},"image":{"@id":"https:\/\/ccbill.com\/kb\/what-is-an-api-call#primaryimage"},"thumbnailUrl":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call.png","datePublished":"2022-09-15T06:59:58+00:00","dateModified":"2023-10-04T13:15:20+00:00","description":"Explore analyzed examples from CCBill's API documentation to find out what an API call is, how it works, and how to make one.","breadcrumb":{"@id":"https:\/\/ccbill.com\/kb\/what-is-an-api-call#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ccbill.com\/kb\/what-is-an-api-call"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ccbill.com\/kb\/what-is-an-api-call#primaryimage","url":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call.png","contentUrl":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2022\/09\/what-is-an-api-call.png","width":800,"height":400,"caption":"What is an API call?"},{"@type":"BreadcrumbList","@id":"https:\/\/ccbill.com\/kb\/what-is-an-api-call#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"KB Home","item":"https:\/\/ccbill.com\/kb\/"},{"@type":"ListItem","position":2,"name":"Web Development","item":"https:\/\/ccbill.com\/kb\/category\/web-development"},{"@type":"ListItem","position":3,"name":"What is an API Call?"}]},{"@type":"WebSite","@id":"https:\/\/ccbill.com\/kb\/#website","url":"https:\/\/ccbill.com\/kb\/","name":"CCBill Knowledge Base","description":"","publisher":{"@id":"https:\/\/ccbill.com\/kb\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ccbill.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ccbill.com\/kb\/#organization","name":"CCBill","url":"https:\/\/ccbill.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ccbill.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2020\/10\/ccbill-logo.png","contentUrl":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2020\/10\/ccbill-logo.png","width":160,"height":70,"caption":"CCBill"},"image":{"@id":"https:\/\/ccbill.com\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ccbillBIZ\/","https:\/\/x.com\/CCBillBIZ","https:\/\/www.linkedin.com\/company\/ccbill","https:\/\/www.youtube.com\/c\/CCBillBiz"]},{"@type":"Person","@id":"https:\/\/ccbill.com\/kb\/#\/schema\/person\/aafe23f5acc151902c3d0955500581dc","name":"Mirjana Tosic","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ccbill.com\/kb\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8ee0e92286c77cd8bcc10b1a3ae2090ca031b41c53f0b1e803e6b69e4bea8409?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8ee0e92286c77cd8bcc10b1a3ae2090ca031b41c53f0b1e803e6b69e4bea8409?s=96&d=mm&r=g","caption":"Mirjana Tosic"},"description":"Mirjana Tosic is a Technical Writer with a background in Web Design and Development. Despite being one of the youngest members of CCBill, her writing skills and technical aptitude help her produce factual, informative, and user-friendly content. If not writing or learning a new skill, you'll find her binging fintech and marketing videos or gaming."}]}},"_links":{"self":[{"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/posts\/4175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/comments?post=4175"}],"version-history":[{"count":22,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/posts\/4175\/revisions"}],"predecessor-version":[{"id":5135,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/posts\/4175\/revisions\/5135"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/media\/4176"}],"wp:attachment":[{"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/media?parent=4175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/categories?post=4175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/tags?post=4175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}