

<!-- Home: no -->{"id":58209,"date":"2022-11-01T18:28:35","date_gmt":"2022-11-01T18:28:35","guid":{"rendered":"https:\/\/sonetel.com\/?page_id=58209"},"modified":"2024-06-21T17:14:30","modified_gmt":"2024-06-21T17:14:30","slug":"make-calls-api","status":"publish","type":"page","link":"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/","title":{"rendered":"Make Calls API"},"content":{"rendered":"<p><strong>Start calls between any two parties by using a simple API.<\/strong><\/p>\n<p>The Make Calls API allows you to set up calls to two separate endpoints, and then bridge those two calls together.<\/p>\n<div class=\"article-image-wrapper\"><a href=\"https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-54558\" src=\"https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash.jpg\" alt=\"\" width=\"1920\" height=\"1282\" srcset=\"https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash.jpg 1920w, https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash-300x200.jpg 300w, https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash-1024x684.jpg 1024w, https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash-768x513.jpg 768w, https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash-1536x1026.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/div>\n<h2>How to use the Make Calls API<\/h2>\n<p>The API can be used to set up a call between yourself &#8211; or one of your employees &#8211; and any other party.\u00a0 You can for example set up calls to customers, friends or whoever you want.<\/p>\n<p>You can find the <a href=\"https:\/\/docs.sonetel.com\/docs\/sonetel-documentation\/9795c7fd58a87-make-calls\" target=\"_blank\" rel=\"noopener\">documentation here<\/a>.<\/p>\n<p>In the API you need to define the following;<\/p>\n<ul>\n<li>Call 1<br \/>\n<span style=\"color: #808080;\">Define the destination that should be called first and what phone number that should be shown to that party.<\/span><\/li>\n<li>Call 2<br \/>\n<span style=\"color: #808080;\">Define the destination of the 2nd call. This call will be started as soon as Call 1 is answered. Also define what phone number to show to the party called.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>Where can calls be made to?<\/h2>\n<p>Both call 1 and 2 can be made to different types of destinations.<\/p>\n<ul>\n<li>Phone numbers<br \/>\n<span style=\"color: #808080;\">Any regular phone numbers worldwide can be called. This will incur<\/span> <a href=\"https:\/\/sonetel.com\/en\/prices\/international-calls\/\" target=\"_blank\" rel=\"noopener\">local calling charges<\/a>.<\/li>\n<li>SIP-addresses<br \/>\n<span style=\"color: #808080;\">Any regular SIP address can be called.<\/span><\/li>\n<li>Users<br \/>\n<span style=\"color: #808080;\">Team members in your account can be called by entering their email address as destination. The User&#8217;s own call settings for incoming calls will define how the call is handled from there on.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div class=\"blue-wrapper\">Setting up calls to an IVR to make robo-calls is strictly prohibited.<\/div>\n<h2><\/h2>\n<h2>Sample Python script to make calls using the API<\/h2>\n<pre style=\"padding-left: 40px; background-color: #f4f4f4;\">import requests\r\nimport json\r\n\r\n# API Base URL\r\nbase_url = \"https:\/\/public-api.sonetel.com\/\"\r\n\r\n\r\n# Phone numbers that the callback API will use.\r\n#\r\n# phone_1 should be your phone number i.e the number of the person making the call.\r\n# phone_2 should be the number of the person being called.\r\n# \r\n# It is recommended that both the numbers be entered in the international +NUMBER format.\r\nphone_1 = \"+NUMBER1\"\r\nphone_2 = \"+NUMBER2\"\r\n\r\n# Generate an API access token and use it to verify your identity.\r\n# \r\n# How to generate an access token?\r\n# https:\/\/docs.sonetel.com\/docs\/sonetel-documentation\/YXBpOjExMzI3NDM3-authentication\r\naccess_token = \"ENTER_ACCESS_TOKEN\"\r\n\r\n\r\n\r\n# Create the Headers to be used in the POST request.\r\nheaders = {\"Authorization\": \"Bearer {}\".format(access_token),\r\n            'Content-Type': 'application\/json;charset=UTF-8'\r\n            }\r\n\r\n\r\n# The payload contains the body that will be sent with the request.\r\n# Here is a brief explanation of the fields:\r\n# \r\n# -&gt; app_id: a string to uniquely identify the app that is making the request. You can replace the default string with your own value such as \"MyCallbackApp_1.2.3 if needed.\"\r\n# -&gt; call1: the phone number of the first person that will receive the call. This should be your phone number.\r\n# -&gt; call2: the number of the second person that will receive the call. This should be the number of the person you wish to speak to. \r\n# -&gt; show_1 &amp; show_2: the caller ID to be shown in the first and second leg of the call. Only a number that you are allowed to display as the caller ID can be used. It is recommended to use default 'automatic' setting.\r\n\r\npayload =json.dumps({\r\n  \"app_id\": 'SonetelCallbackApp_Python',\r\n  \"call1\": phone_1,\r\n  \"call2\": phone_2,\r\n  \"show_1\": \"automatic\",\r\n  \"show_2\": \"automatic\"\r\n})\r\n\r\n# Function to initiate callback.\r\ndef make_call(url: str, headers: dict, payload: str) -&gt; None:\r\n    \"\"\"\r\n    Initiate the callback request using Sonetel's callback API.\r\n\r\n    Parameters\r\n    1. url - the Base API URI.\r\n    2. headers - the headers to be sent with the API request.\r\n    3. payload - the request body.\r\n\r\n    Return: None\r\n    \r\n    This function does not return any value. The success and failure messages are printed to the console.\r\n    \"\"\"\r\n    try:\r\n      response = requests.request(\r\n        \"POST\",\r\n        \"{}make-calls\/call\/call-back\".format(url),\r\n        headers=headers,\r\n        data=payload\r\n        ).json()\r\n\r\n      response.raise_for_status()\r\n      print(response)\r\n    except requests.exceptions.RequestException as e:\r\n      raise SystemExit(e)\r\n\r\n# Start the call.\r\nmake_call(url=base_url, headers=headers, payload=payload)\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Start calls between any two parties by using a simple API. The Make Calls API allows you to set up&#8230;<\/p>\n","protected":false},"author":3,"featured_media":54558,"parent":58131,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"templates\/help-subtopic-subsite.php","meta":{"footnotes":""},"class_list":["post-58209","page","type-page","status-publish","has-post-thumbnail","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.5 (Yoast SEO v25.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Make Calls API - Sonetel<\/title>\n<meta name=\"description\" content=\"Start calls between any two parties by using a simple API. The Make Calls API allows you to set up calls to two separate endpoints, and then bridge those\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Make Calls API\" \/>\n<meta property=\"og:description\" content=\"Start calls between any two parties by using a simple API. The Make Calls API allows you to set up calls to two separate endpoints, and then bridge those\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/\" \/>\n<meta property=\"og:site_name\" content=\"Sonetel\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sonetel\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-21T17:14:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1282\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@Sonetel\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/\",\"url\":\"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/\",\"name\":\"Make Calls API - Sonetel\",\"isPartOf\":{\"@id\":\"https:\/\/sonetel.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash.jpg\",\"datePublished\":\"2022-11-01T18:28:35+00:00\",\"dateModified\":\"2024-06-21T17:14:30+00:00\",\"description\":\"Start calls between any two parties by using a simple API. The Make Calls API allows you to set up calls to two separate endpoints, and then bridge those\",\"breadcrumb\":{\"@id\":\"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/#primaryimage\",\"url\":\"https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash.jpg\",\"contentUrl\":\"https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash.jpg\",\"width\":1920,\"height\":1282},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sonetel.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Developer\",\"item\":\"https:\/\/sonetel.com\/en\/developer\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Help\",\"item\":\"https:\/\/sonetel.com\/en\/developer\/help\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Telephony API\",\"item\":\"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Make Calls API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/sonetel.com\/#website\",\"url\":\"https:\/\/sonetel.com\/\",\"name\":\"Sonetel\",\"description\":\"A TELEPHONE SERVICE FOR GLOBAL ENTREPRENEURS\",\"publisher\":{\"@id\":\"https:\/\/sonetel.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/sonetel.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/sonetel.com\/#organization\",\"name\":\"Sonetel\",\"url\":\"https:\/\/sonetel.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sonetel.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/sonetel.com\/wp-content\/uploads\/2017\/10\/logo_horizontal.png\",\"contentUrl\":\"https:\/\/sonetel.com\/wp-content\/uploads\/2017\/10\/logo_horizontal.png\",\"width\":137,\"height\":44,\"caption\":\"Sonetel\"},\"image\":{\"@id\":\"https:\/\/sonetel.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/sonetel\",\"https:\/\/x.com\/Sonetel\",\"https:\/\/www.linkedin.com\/company\/sonetel\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Make Calls API - Sonetel","description":"Start calls between any two parties by using a simple API. The Make Calls API allows you to set up calls to two separate endpoints, and then bridge those","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:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/","og_locale":"en_US","og_type":"article","og_title":"Make Calls API","og_description":"Start calls between any two parties by using a simple API. The Make Calls API allows you to set up calls to two separate endpoints, and then bridge those","og_url":"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/","og_site_name":"Sonetel","article_publisher":"https:\/\/www.facebook.com\/sonetel","article_modified_time":"2024-06-21T17:14:30+00:00","og_image":[{"width":1920,"height":1282,"url":"https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@Sonetel","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/","url":"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/","name":"Make Calls API - Sonetel","isPartOf":{"@id":"https:\/\/sonetel.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/#primaryimage"},"image":{"@id":"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/#primaryimage"},"thumbnailUrl":"https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash.jpg","datePublished":"2022-11-01T18:28:35+00:00","dateModified":"2024-06-21T17:14:30+00:00","description":"Start calls between any two parties by using a simple API. The Make Calls API allows you to set up calls to two separate endpoints, and then bridge those","breadcrumb":{"@id":"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/#primaryimage","url":"https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash.jpg","contentUrl":"https:\/\/sonetel.com\/wp-content\/uploads\/2022\/06\/christina-wocintechchat-com-mhmNmzxHBWs-unsplash.jpg","width":1920,"height":1282},{"@type":"BreadcrumbList","@id":"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/make-calls-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sonetel.com\/en\/"},{"@type":"ListItem","position":2,"name":"Developer","item":"https:\/\/sonetel.com\/en\/developer\/"},{"@type":"ListItem","position":3,"name":"Help","item":"https:\/\/sonetel.com\/en\/developer\/help\/"},{"@type":"ListItem","position":4,"name":"Telephony API","item":"https:\/\/sonetel.com\/en\/developer\/help\/telephony-api\/"},{"@type":"ListItem","position":5,"name":"Make Calls API"}]},{"@type":"WebSite","@id":"https:\/\/sonetel.com\/#website","url":"https:\/\/sonetel.com\/","name":"Sonetel","description":"A TELEPHONE SERVICE FOR GLOBAL ENTREPRENEURS","publisher":{"@id":"https:\/\/sonetel.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sonetel.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/sonetel.com\/#organization","name":"Sonetel","url":"https:\/\/sonetel.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sonetel.com\/#\/schema\/logo\/image\/","url":"https:\/\/sonetel.com\/wp-content\/uploads\/2017\/10\/logo_horizontal.png","contentUrl":"https:\/\/sonetel.com\/wp-content\/uploads\/2017\/10\/logo_horizontal.png","width":137,"height":44,"caption":"Sonetel"},"image":{"@id":"https:\/\/sonetel.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/sonetel","https:\/\/x.com\/Sonetel","https:\/\/www.linkedin.com\/company\/sonetel"]}]}},"_links":{"self":[{"href":"https:\/\/sonetel.com\/en\/wp-json\/wp\/v2\/pages\/58209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sonetel.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sonetel.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sonetel.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/sonetel.com\/en\/wp-json\/wp\/v2\/comments?post=58209"}],"version-history":[{"count":2,"href":"https:\/\/sonetel.com\/en\/wp-json\/wp\/v2\/pages\/58209\/revisions"}],"predecessor-version":[{"id":75644,"href":"https:\/\/sonetel.com\/en\/wp-json\/wp\/v2\/pages\/58209\/revisions\/75644"}],"up":[{"embeddable":true,"href":"https:\/\/sonetel.com\/en\/wp-json\/wp\/v2\/pages\/58131"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sonetel.com\/en\/wp-json\/wp\/v2\/media\/54558"}],"wp:attachment":[{"href":"https:\/\/sonetel.com\/en\/wp-json\/wp\/v2\/media?parent=58209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}