### Get Switch Example Source: https://developers.ringcentral.com/api-reference/Automatic-Location-Updates/readSwitch This example demonstrates how to make a GET request to retrieve switch information. It includes the request path and a sample JSON response. ```http GET /restapi/v1.0/account/401568934008/emergency-address-auto-update/switches/5461008 HTTP/1.1 200 OK { "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/401568934008/emergency-address-auto-update/switches/5461008", "id" : "5461008", "chassisId" : "192.168.5.9", "name" : "Building 1 Floor 13", "site" : { "id" : "401592370008", "name" : "Site" }, "emergencyAddress" : { "street" : "20 DVS DRIVE", "city" : "BELMONT", "stateId" : "16", "stateName" : "California", "state" : "CA", "zip" : "94002", "countryId" : "1", "countryName" : "United States", "country" : "US" }, "emergencyLocationId" : "6502008" } ``` -------------------------------- ### Example: Get Forwarding Targets Source: https://developers.ringcentral.com/api-reference/Forwarding-Targets/listExtensionsUsingForwardingDeviceTarget Demonstrates a GET request to retrieve forwarding targets for a given device. Includes example request and response bodies. ```HTTP **Request** GET /restapi/v2/accounts/672088165/extensions/672091165/comm-handling/voice/forwarding-targets/devices/18423165/extensions **Response** HTTP/1.1 200 OK { "referencedExtensions": [ { "id": "672092165" } ], "paging": { "perPage": 100, "page": 1, "pageStart": 0, "pageEnd": 0, "totalPages": 1, "totalElements": 1 } } ``` -------------------------------- ### Get Authorization Profile Example Source: https://developers.ringcentral.com/api-reference/User-Permissions/readAuthorizationProfile This example demonstrates how to request the authorization profile for an extension. It shows the GET request path and a sample JSON response containing user permissions and their scopes. ```http GET /restapi/v1.0/account/~/extension/~/authz-profile ``` ```json HTTP/1.1 200 OK { "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/401172177008/extension/401172177008/authz-profile", "permissions" : [ { "permission" : { "uri" : "https://platform.ringcentral.com/restapi/v1.0/dictionary/permission/AccountAdministration", "id" : "AccountAdministration" }, "scopes" : [ "Account" ] }, { "permission" : { "uri" : "https://platform.ringcentral.com/restapi/v1.0/dictionary/permission/AccountValidation", "id" : "AccountValidation" }, "scopes" : [ "Account" ] }, { "permission" : { "uri" : "https://platform.ringcentral.com/restapi/v1.0/dictionary/permission/ActiveDirectory", "id" : "ActiveDirectory" }, "scopes" : [ "Account" ] }, { "permission" : { "uri" : "https://platform.ringcentral.com/restapi/v1.0/dictionary/permission/AddRemoveDevices", "id" : "AddRemoveDevices" }, "scopes" : [ "Account" ] }, { "permission" : { "uri" : "https://platform.ringcentral.com/restapi/v1.0/dictionary/permission/AddRemoveGroups", "id" : "AddRemoveGroups" }, "scopes" : [ "NonUserExtensions" ] }, {...} ] } ``` -------------------------------- ### Get Account Federation API Example Source: https://developers.ringcentral.com/api-reference/Internal-Contacts/readDirectoryFederation This example demonstrates how to make a GET request to retrieve account federation information. It includes the request path and a sample JSON response. ```http GET /restapi/v1.0/account/~/directory/federation HTTP/1.1 200 OK { "id" : "1721008", "displayName" : "My federation", "creationTime" : "2017-06-09T10:20:22Z", "lastModifiedTime" : "2017-06-09T10:29:43Z", "accounts" : [ { "id" : "400248793008", "companyName" : "My company", "federatedName" : "My federation", "linkCreationTime" : "2017-06-09T10:22:48Z", "mainNumber" : { "phoneNumber" : "+18772009098", "formattedPhoneNumber" : "(877) 200-9098" }, "conflictCount" : 0 }, { "id" : "400248807008", "companyName" : "My company", "federatedName" : "My federation", "linkCreationTime" : "2017-06-09T10:29:43Z", "mainNumber" : { "phoneNumber" : "+14159130525", "formattedPhoneNumber" : "(415) 913-0525" }, "conflictCount" : 3 } ] } ``` -------------------------------- ### Get Team Example Request and Response Source: https://developers.ringcentral.com/api-reference/Teams/readGlipTeamNew Shows an example of a GET request to retrieve team details and its corresponding successful JSON response. ```json GET /team-messaging/v1/teams/232087558 HTTP/1.1 200 OK { "id": "232087558", "name": "Team #1", "type": "Team", "status": "Active", "public": true, "creationTime": "2014-05-15T05:23:08.892Z", "lastModifiedTime": "2018-09-14T14:33:25.247Z" } ``` -------------------------------- ### Get Company Info Request and Response Example Source: https://developers.ringcentral.com/api-reference/Profile/readTMCompanyInfoNew Demonstrates a sample GET request to retrieve company information and its corresponding successful JSON response. ```http **Request** GET /team-messaging/v1/companies/37439510 **Response** HTTP/1.1 200 OK { "id": "37439510", "name": "RingCentral", "domain": "ringcentral.com", "creationTime": "2014-05-15T05:23:08.867Z", "lastModifiedTime": "2018-12-10T13:37:43.156Z" } ``` -------------------------------- ### Get Call Flip Numbers (JavaScript) Source: https://developers.ringcentral.com/api-reference/Call-Flip/readCallFlipSettings This JavaScript example shows how to get call flip numbers using the RingCentral SDK. Ensure the SDK is installed and your credentials are set in the environment. ```javascript // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // PATH PARAMETERS const accountId = ''; const extensionId = ''; const SDK = require('ringcentral'); const rcsdk = new SDK({ 'server': process.env.RC_SERVER_URL, 'clientId': process.env.RC_CLIENT_ID, 'clientSecret': process.env.RC_CLIENT_SECRET }); const platform = rcsdk.platform(); platform.login({ jwt: process.env.RC_JWT }).then(() => { platform.get(`/restapi/v2/accounts/${accountId}/extensions/${extensionId}/call-flip-numbers`).then((r) => { // PROCESS RESPONSE }); }); ``` -------------------------------- ### Register Device SIP Provisioning (WebRTC Example) Source: https://developers.ringcentral.com/api-reference/Device-SIP-Registration This example demonstrates how to provision a WebRTC device by sending a POST request with SIP information. It includes the request body and a sample successful response. ```http **Request** POST /restapi/v1.0/client-info/sip-provision { "sipInfo": [ { "transport": "WSS" } ] } **Response** HTTP/1.1 200 OK { "device": { "uri": "https://platform.ringcentral.com/restapi/v1.0/account/809646016/device/802398804016", "id": "802398804016", "type": "WebPhone", "status": "Online", "extension": { "uri": "https://platform.ringcentral.com/restapi/v1.0/account/809646016/extension/62264425016", "id": 62264425016, "extensionNumber": "115" }, "phoneLines": [ { "id" : "45200035" "lineType": "Standalone", "emergencyAddress": { "required": true, "localOnly": false }, "phoneInfo": { "id": 121116105016, "phoneNumber": "+16504223279", "paymentType": "Local", "type": "VoiceFax", "usageType": "DirectNumber", "country": { "uri": "https://platform.ringcentral.com/restapi/v1.0/dictionary/country/1", "id": "1", "name": "United States" } } } ], "emergency": { "address": { "street": "20 DVS DRIVE", "street2": "FL 1", "city": "BELMONT", "stateId": "16", "stateName": "California", "state": "CA", "zip": "94002", "countryId": "1", "countryName": "United States", "country": "US", "customerName": "Company X" }, "location": { "id": "20676", "name": "Home office" }, "addressEditable": "MainDevice", "outOfCountry": false, "addressStatus": "Processing", "visibility": "Personal", "syncStatus": "Updated" }, "emergencyServiceAddress": { "street": "20 DAVIS DR", "street2": "", "city": "BELMONT", "state": "CA", "stateId": "16", "stateIsoCode": "CA", "stateName": "California", "country": "US", "countryId": "1", "countryIsoCode": "US", "countryName": "United States", "zip": "94002", "customerName": "John Smith", "outOfCountry": false }, "linePooling": "Guest" }, "sipInfo": [ { "transport": "WSS", "username": "17203861294*115", "password": "0XeL9qcf", "authorizationId": "802398804016", "domain": "sip.ringcentral.com", "outboundProxy": "sip112-191.ringcentral.com:8083", "outboundProxyBackup": "sip132-171.ringcentral.com:8083" } ], "sipInfoPstn": [], "sipFlags": { "voipFeatureEnabled": true, "voipCountryBlocked": false, "outboundCallsEnabled": true, "dscpEnabled": false, "dscpSignaling": 26, "dscpVoice": 46, "dscpVideo": 34 }, "sipErrorCodes": [ "408" ] } ``` -------------------------------- ### Get Post using PHP Source: https://developers.ringcentral.com/api-reference/Posts/readGlipPostNew PHP script to get post details. This example assumes you have the RingCentral SDK installed via Composer. Replace placeholders with your actual chat ID and post ID. ```php '; $postId = ''; require('vendor/autoload.php'); $rcsdk = new RingCentral\SDK\SDK($_ENV['RC_CLIENT_ID'], $_ENV['RC_CLIENT_SECRET'], $_ENV['RC_SERVER_URL']); $platform = $rcsdk->platform(); $platform->login([ "jwt" => $_ENV['RC_JWT'] ]); $r = $platform->get("/team-messaging/v1/chats/{$chatId}/posts/{$postId}"); // PROCESS RESPONSE ?> ``` -------------------------------- ### Create Site using C# SDK Source: https://developers.ringcentral.com/api-reference/Multi-Site/createSite This C# example shows how to create a site using the RingCentral REST Client. It involves setting up environment variables for authentication and defining the site creation request object. ```csharp // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // PATH PARAMETERS string accountId = ""; // POST BODY CreateSiteRequest createSiteRequest = new CreateSiteRequest { id = "", name = "", extensionNumber = "", callerIdName = "", email = "", businessAddress = new ContactBusinessAddressInfo { country = "", state = "", city = "", street = "", zip = "" }, regionalSettings = new RegionalSettings { homeCountry = new CountryInfoShortModel { id = "", uri = "" }, timezone = new TimezoneInfoBase { uri = "", id = "", name = "", description = "", bias = "" }, language = new RegionalLanguageInfo { id = "", localeCode = "", name = "" }, greetingLanguage = new GreetingLanguageInfo { id = "", localeCode = "", name = "" }, formattingLocale = new FormattingLocaleInfo { id = "", localeCode = "", name = "" }, timeFormat = '12h' }, @operator = new SiteOperatorReference { id = "" }, siteAccess = 'Limited', accessibleSiteIds = new[] { "", }, code = "", costCenter = new CostCenterInfo { id = "", name = "" } }; RestClient rc = new RestClient( Environment.GetEnvironmentVariable("RC_CLIENT_ID"), Environment.GetEnvironmentVariable("RC_CLIENT_SECRET"), Environment.GetEnvironmentVariable("RC_SERVER_URL") ); rc.Authorize( Environment.GetEnvironmentVariable("RC_JWT")).Wait(); var r = await rc.Restapi().Account(accountId).Sites().Post(createSiteRequest); // PROCESS RESPONSE ``` -------------------------------- ### Get Blocked Number (JavaScript) Source: https://developers.ringcentral.com/api-reference/Call-Blocking/readBlockedAllowedNumber This JavaScript example shows how to get a blocked number using the RingCentral SDK. Ensure your SDK is installed and credentials are set as environment variables. Replace placeholder IDs. ```JavaScript // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // PATH PARAMETERS const accountId = ''; const extensionId = ''; const blockedNumberId = ''; const SDK = require('ringcentral'); const rcsdk = new SDK({ 'server': process.env.RC_SERVER_URL, 'clientId': process.env.RC_CLIENT_ID, 'clientSecret': process.env.RC_CLIENT_SECRET }); const platform = rcsdk.platform(); platform.login({ jwt: process.env.RC_JWT }).then(() => { platform.get(`/restapi/v1.0/account/${accountId}/extension/${extensionId}/caller-blocking/phone-numbers/${blockedNumberId}`).then((r) => { // PROCESS RESPONSE }); }); ``` -------------------------------- ### C# Example for Bulk Switch Creation Source: https://developers.ringcentral.com/api-reference/Automatic-Location-Updates/createMultipleSwitches This C# snippet shows how to set up the account ID for the bulk switch creation request. It's a basic setup for the path parameter. ```csharp // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // PATH PARAMETERS string accountId = ""; ``` -------------------------------- ### Get Network by ID using PHP Source: https://developers.ringcentral.com/api-reference/Automatic-Location-Updates/readNetwork This PHP example illustrates how to authenticate and make a GET request to retrieve network details. Ensure you have the RingCentral SDK installed via Composer and your credentials configured. ```php '; $networkId = ''; require('vendor/autoload.php'); $rcsdk = new RingCentral\SDK\SDK($_ENV['RC_CLIENT_ID'], $_ENV['RC_CLIENT_SECRET'], $_ENV['RC_SERVER_URL']); $platform = $rcsdk->platform(); $platform->login([ "jwt" => $_ENV['RC_JWT'] ]); $r = $platform->get("/restapi/v1.0/account/{$accountId}/emergency-address-auto-update/networks/{$networkId}"); // PROCESS RESPONSE ?> ``` -------------------------------- ### Create Subscription using C# Source: https://developers.ringcentral.com/api-reference/Subscriptions/createSubscription This C# example demonstrates how to create a subscription. Ensure your RingCentral SDK is configured with the necessary credentials. ```csharp // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // POST BODY CreateSubscriptionRequest createSubscriptionRequest = new CreateSubscriptionRequest { eventFilters = new[] { "", }, expiresIn = 000 }; RestClient rc = new RestClient( Environment.GetEnvironmentVariable("RC_CLIENT_ID"), Environment.GetEnvironmentVariable("RC_CLIENT_SECRET"), Environment.GetEnvironmentVariable("RC_SERVER_URL") ); rc.Authorize( Environment.GetEnvironmentVariable("RC_JWT")).Wait(); var r = await rc.Restapi().Subscription().Post(createSubscriptionRequest); // PROCESS RESPONSE ``` -------------------------------- ### Get User Business Hours with JavaScript SDK Source: https://developers.ringcentral.com/api-reference/Business-Hours/readUserBusinessHours This JavaScript example shows how to get user business hours using the RingCentral SDK. Ensure your SDK is installed and your API credentials are set as environment variables. ```javascript // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // PATH PARAMETERS const accountId = ''; const extensionId = ''; const SDK = require('ringcentral'); const rcsdk = new SDK({ 'server': process.env.RC_SERVER_URL, 'clientId': process.env.RC_CLIENT_ID, 'clientSecret': process.env.RC_CLIENT_SECRET }); const platform = rcsdk.platform(); platform.login({ jwt: process.env.RC_JWT }).then(() => { platform.get(`/restapi/v1.0/account/${accountId}/extension/${extensionId}/business-hours`).then((r) => { // PROCESS RESPONSE }); }); ``` -------------------------------- ### Example Request and Response Source: https://developers.ringcentral.com/api-reference/User-Permissions/checkUserPermission Demonstrates a sample GET request to check user permission and its successful JSON response. ```HTTP **Request** GET /restapi/v1.0/account/~/extension/~/authz-profile/check?permissionId=ReadMessages&targetExtensionId=401172186008 **Response** HTTP/1.1 200 OK { "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/401172177008/extension/401172177008/authz-profile/check?permissionId=ReadMessages&targetExtensionId=401172186008", "successful" : true, "details" : { "permission" : { "uri" : "https://platform.ringcentral.com/restapi/v1.0/dictionary/permission/ReadMessages", "id" : "ReadMessages" }, "scopes" : [ "AllExtensions" ] } } ``` -------------------------------- ### Get Contacts Upload Task (PHP) Source: https://developers.ringcentral.com/api-reference/External-Contacts/getAddressBookBulkUploadTask This PHP example illustrates how to get the status of a contacts upload task using the RingCentral SDK. Make sure to install the SDK via Composer and set up your environment variables. ```php '; $taskId = ''; require('vendor/autoload.php'); $rcsdk = new RingCentral\SDK\SDK($_ENV['RC_CLIENT_ID'], $_ENV['RC_CLIENT_SECRET'], $_ENV['RC_SERVER_URL']); $platform = $rcsdk->platform(); $platform->login([ "jwt" => $_ENV['RC_JWT'] ]); $r = $platform->get("/restapi/v1.0/account/{$accountId}/address-book-bulk-upload/tasks/{$taskId}"); // PROCESS RESPONSE ?> ``` -------------------------------- ### Get Account Greeting Media Content using C# Source: https://developers.ringcentral.com/api-reference/Greetings/readGreetingContent This C# example demonstrates how to fetch greeting media content. It involves setting up the RestClient, authorizing with JWT, and then making the GET request to the media endpoint. ```csharp // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // PATH PARAMETERS string accountId = ""; string extensionId = ""; string greetingId = ""; // OPTIONAL QUERY PARAMETERS ReadGreetingContentParameters readGreetingContentParameters = new ReadGreetingContentParameters { }; RestClient rc = new RestClient( Environment.GetEnvironmentVariable("RC_CLIENT_ID"), Environment.GetEnvironmentVariable("RC_CLIENT_SECRET"), Environment.GetEnvironmentVariable("RC_SERVER_URL") ); rc.Authorize( Environment.GetEnvironmentVariable("RC_JWT")).Wait(); var r = await rc._media().Restapi().Account(accountId).Extension(extensionId).Greeting(greetingId).Content().Get(readGreetingContentParameters); // PROCESS RESPONSE ``` -------------------------------- ### Start Call Recording (PHP) Source: https://developers.ringcentral.com/api-reference/Call-Control/startCallRecording A PHP example for initiating call recording. Ensure the RingCentral SDK is installed via Composer and credentials are set. ```PHP '; $telephonySessionId = ''; $partyId = ''; require('vendor/autoload.php'); $rcsdk = new RingCentral\SDK\SDK($_ENV['RC_CLIENT_ID'], $_ENV['RC_CLIENT_SECRET'], $_ENV['RC_SERVER_URL']); $platform = $rcsdk->platform(); $platform->login([ "jwt" => $_ENV['RC_JWT'] ]); $r = $platform->post("/restapi/v1.0/account/{$accountId}/telephony/sessions/{$telephonySessionId}/parties/{$partyId}/recordings"); // PROCESS RESPONSE ?> ``` -------------------------------- ### Get Default Bridge (PHP) Source: https://developers.ringcentral.com/api-reference/Bridge-Management/getDefaultBridge PHP code snippet to retrieve the default bridge. This example assumes you have the RingCentral SDK installed via Composer. ```php '; $extensionId = ''; require('vendor/autoload.php'); $rcsdk = new RingCentral\SDK\SDK($_ENV['RC_CLIENT_ID'], $_ENV['RC_CLIENT_SECRET'], $_ENV['RC_SERVER_URL']); $platform = $rcsdk->platform(); $platform->login([ "jwt" => $_ENV['RC_JWT'] ]); $r = $platform->get("/rcvideo/v2/account/{$accountId}/extension/{$extensionId}/bridges/default"); // PROCESS RESPONSE ?> ``` -------------------------------- ### Create Site using Python SDK Source: https://developers.ringcentral.com/api-reference/Multi-Site/createSite This Python snippet demonstrates how to create a site using the RingCentral SDK. It requires setting up environment variables for credentials and then constructing the POST body with site information. ```python # https://developers.ringcentral.com/my-account.html#/applications # Find your credentials at the above url, set them as environment variables, or enter them below # PATH PARAMETERS accountId = '' # POST BODY body = { 'id': '', 'name': '', 'extensionNumber': '', 'callerIdName': '', 'email': '', 'businessAddress': { 'country': '', 'state': '', 'city': '', 'street': '', 'zip': '' }, 'regionalSettings': { 'homeCountry': { 'id': '', 'uri': '' }, 'timezone': { 'uri': '', 'id': '', 'name': '', 'description': '', 'bias': '' }, 'language': { 'id': '', 'localeCode': '', 'name': '' }, 'greetingLanguage': { 'id': '', 'localeCode': '', 'name': '' }, 'formattingLocale': { 'id': '', 'localeCode': '', 'name': '' }, 'timeFormat': '12h' }, 'operator': { 'id': '' }, 'siteAccess': 'Limited', 'accessibleSiteIds': [ '' ], 'code': '', 'costCenter': { 'id': '', 'name': '' } } import os from ringcentral import SDK rcsdk = SDK(os.environ['RC_CLIENT_ID'], os.environ['RC_CLIENT_SECRET'], os.environ['RC_SERVER_URL']) platform = rcsdk.platform() platform.login( jwt=os.environ.get('RC_JWT') ) r = platform.post(f'/restapi/v1.0/account/{accountId}/sites', body) # PROCESS RESPONSE ``` -------------------------------- ### Create Switch Request and Response Example Source: https://developers.ringcentral.com/api-reference/Automatic-Location-Updates/createSwitch This snippet shows a sample POST request to create a new switch, including essential parameters like chassisId, name, site, and emergencyAddress. It also includes a typical 200 OK response with the created switch's details. ```json **Request** POST /restapi/v1.0/account/401568934008/emergency-address-auto-update/switches { "chassisId":"192.168.5.9", "name":"Building 1 Floor 13", "site": {"id": "401592370008" }, "emergencyAddress":{ "street":"13 ELM STREET", "street2":"1 FLR, WEST WING", "city":"FOSTER CITY", "state":"CA", "country":"US", "zip":"94404" } } **Response** HTTP/1.1 200 OK { "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/401568934008/emergency-address-auto-update/switches/5461008", "id" : "5461008", "chassisId" : "192.168.5.9", "name" : "Building 1 Floor 13", "site" : { "id" : "401592370008", "name" : "Site" }, "emergencyAddress" : { "street" : "20 DVS DRIVE", "city" : "BELMONT", "stateId" : "16", "stateName" : "California", "state" : "CA", "zip" : "94002", "countryId" : "1", "countryName" : "United States", "country" : "US" }, "emergencyLocationId" : "6502008" } ``` -------------------------------- ### Get Voice Interaction Rule (Node.js) Source: https://developers.ringcentral.com/api-reference/Interaction-Rules/readVoiceInteractionRule This Node.js example shows how to get a voice interaction rule using the RingCentral SDK. Ensure the SDK is installed and your credentials are set as environment variables. Replace placeholder path parameters. ```javascript // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // PATH PARAMETERS const accountId = ''; const extensionId = ''; const ruleId = ''; const SDK = require('ringcentral'); const rcsdk = new SDK({ 'server': process.env.RC_SERVER_URL, 'clientId': process.env.RC_CLIENT_ID, 'clientSecret': process.env.RC_CLIENT_SECRET }); const platform = rcsdk.platform(); platform.login({ jwt: process.env.RC_JWT }).then(() => { platform.get(`/restapi/v2/accounts/${accountId}/extensions/${extensionId}/comm-handling/voice/interaction-rules/${ruleId}`).then((r) => { // PROCESS RESPONSE }); }); ``` -------------------------------- ### Request Example Source: https://developers.ringcentral.com/api-reference/Call-Recording-Settings/updateCallRecordingExtensionList Demonstrates the structure of a POST request to bulk assign call recording settings to extensions. ```json **Request** POST /restapi/v1.0/account/1468821004/call-recording/bulk-assign { "addedExtensions": [ { "id": "1468821004", "callDirection": "All" } ], "updatedExtensions": [ { "id": "1468823004", "callDirection": "Outbound" } ] } **Response** HTTP/1.1 204 No Content ``` -------------------------------- ### Get User Profile Image using C# Source: https://developers.ringcentral.com/api-reference/User-Settings/readUserProfileImageLegacy This C# example demonstrates fetching a user's profile image. It requires the RestClient and proper authentication setup. ```csharp // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // PATH PARAMETERS string accountId = ""; string extensionId = ""; RestClient rc = new RestClient( Environment.GetEnvironmentVariable("RC_CLIENT_ID"), Environment.GetEnvironmentVariable("RC_CLIENT_SECRET"), Environment.GetEnvironmentVariable("RC_SERVER_URL") ); rc.Authorize( Environment.GetEnvironmentVariable("RC_JWT")).Wait(); var r = await rc.Restapi().Account(accountId).Extension(extensionId).ProfileImage().List(); // PROCESS RESPONSE ``` -------------------------------- ### Get SMS Configuration (JavaScript) Source: https://developers.ringcentral.com/api-reference/Phone-Numbers/smsConfigurationInfo This JavaScript example shows how to retrieve SMS configuration using the RingCentral SDK. It requires the SDK to be installed and environment variables for authentication. ```javascript // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // PATH PARAMETERS const accountId = ''; const extensionId = ''; const phoneNumberId = ''; const SDK = require('ringcentral'); const rcsdk = new SDK({ 'server': process.env.RC_SERVER_URL, 'clientId': process.env.RC_CLIENT_ID, 'clientSecret': process.env.RC_CLIENT_SECRET }); const platform = rcsdk.platform(); platform.login({ jwt: process.env.RC_JWT }).then(() => { platform.get(`/restapi/v1.0/account/${accountId}/extension/${extensionId}/phone-number/${phoneNumberId}/sms-configuration`).then((r) => { // PROCESS RESPONSE }); }); ``` -------------------------------- ### List Call Queues Example Source: https://developers.ringcentral.com/api-reference/Call-Queues/listCallQueues This example demonstrates how to make a GET request to retrieve a list of call queues. It shows the request URL with query parameters for page size and the expected JSON response structure, including call queue details and pagination information. ```http GET /restapi/v1.0/account/~/call-queues?perPage=20 HTTP/1.1 200 OK { "uri": "https://platform.ringcentral.com/restapi/v1.0/account/230919004/call-queues?page=1&perPage=20", "records": [ { "uri": "https://platform.ringcentral.com/restapi/v1.0/account/26456001/extension/41004", "id": "41004", "extensionNumber": "102", "name": "Support" }, { "uri": "https://platform.ringcentral.com/restapi/v1.0/account/26456001/extension/41023", "id": "41023", "extensionNumber": "106", "name": "Sales" } ], "paging": { "page": 1, "totalPages": 1, "perPage": 20, "totalElements": 2 }, "navigation": { "firstPage": { "uri": "https://platform.ringcentral.com/restapi/v1.0/account/230919004/call-queues?page=1&perPage=20" }, "lastPage": { "uri": "https://platform.ringcentral.com/restapi/v1.0/account/230919004/call-queues?page=1&perPage=20" } } } ``` -------------------------------- ### Get Bridge PHP Example Source: https://developers.ringcentral.com/api-reference/Bridge-Management/getBridge This PHP script utilizes the RingCentral SDK to fetch bridge information. Ensure you have the SDK installed via Composer and your credentials configured. ```php '; // OPTIONAL QUERY PARAMETERS $queryParams = array( ); require('vendor/autoload.php'); $rcsdk = new RingCentral\SDK\SDK($_ENV['RC_CLIENT_ID'], $_ENV['RC_CLIENT_SECRET'], $_ENV['RC_SERVER_URL']); $platform = $rcsdk->platform(); $platform->login([ "jwt" => $_ENV['RC_JWT'] ]); $r = $platform->get("/rcvideo/v2/bridges/{$bridgeId}", $queryParams); // PROCESS RESPONSE ?> ``` -------------------------------- ### Get Team using PHP SDK Source: https://developers.ringcentral.com/api-reference/Teams/readGlipTeamNew Provides a PHP example for retrieving team data via the RingCentral SDK. Make sure to install the SDK using Composer. ```php '; require('vendor/autoload.php'); $rcsdk = new RingCentral\SDK\SDK($_ENV['RC_CLIENT_ID'], $_ENV['RC_CLIENT_SECRET'], $_ENV['RC_SERVER_URL']); $platform = $rcsdk->platform(); $platform->login([ "jwt" => $_ENV['RC_JWT'] ]); $r = $platform->get("/team-messaging/v1/teams/{$chatId}"); // PROCESS RESPONSE ?> ``` -------------------------------- ### Upload File Example (Binary) Source: https://developers.ringcentral.com/api-reference/Posts/createGlipFileNew Demonstrates uploading a single file using binary data. The response includes file details like ID, content URI, and name. ```HTTP **Request** POST /team-messaging/v1/files?name=Screenshot.jpg [binary data] **Response** HTTP/1.1 200 OK [ { "id": "123450", "contentUri": "https://dl.mvp.ringcentral.com/file/123450", "name": "Screenshot.jpg" } ] ``` -------------------------------- ### Get Participant Info (JavaScript) Source: https://developers.ringcentral.com/api-reference/Historical-Webinars/rcwHistoryGetParticipantInfo JavaScript example for retrieving participant information. This snippet uses Node.js and requires the RingCentral SDK to be installed and credentials configured as environment variables. ```javascript // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below const SDK = require('ringcentral'); const rcsdk = new SDK({ 'server': process.env.RC_SERVER_URL, 'clientId': process.env.RC_CLIENT_ID, 'clientSecret': process.env.RC_CLIENT_SECRET }); const platform = rcsdk.platform(); platform.login({ jwt: process.env.RC_JWT }).then(() => { platform.get(`/webinar/history/v1/webinars/${webinarId}/sessions/${sessionId}/participants/self`).then((r) => { // PROCESS RESPONSE }); }); ``` -------------------------------- ### Get Account Info using PHP Source: https://developers.ringcentral.com/api-reference/account This PHP example illustrates fetching account details using the RingCentral SDK. It requires the SDK to be installed via Composer and credentials to be set. ```php '; require('vendor/autoload.php'); $rcsdk = new RingCentral\SDK\SDK($_ENV['RC_CLIENT_ID'], $_ENV['RC_CLIENT_SECRET'], $_ENV['RC_SERVER_URL']); $platform = $rcsdk->platform(); $platform->login([ "jwt" => $_ENV['RC_JWT'] ]); $r = $platform->get("/restapi/v2/accounts/{$accountId}"); // PROCESS RESPONSE ?> ``` -------------------------------- ### Full Sync Example Source: https://developers.ringcentral.com/api-reference/Message-Store/syncMessages Demonstrates a full sync request and its successful JSON response. This is useful for initial data retrieval or when the sync token is invalid. ```http GET /restapi/v1.0/account/400371259008/extension/400371259008/message-sync?syncType=FSync&recordCount=2&distinctConversations=true HTTP/1.1 200 OK { "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/400371259008/extension/400371259008/message-sync?syncType=FSync&recordCount=2&distinctConversations=true", "records" : [ { ... } ], "syncInfo" : { "syncType" : "FSync", "syncToken" : "AQEAAAAAAwAAAVEa8k3QBgAAAAIFAAABURrz6VoTAQgAAABdN_yWgAkBCgGwXNsj", "syncTime" : "2015-11-18T14:16:11.354Z", "olderRecordsExist" : false } } ``` ```json { "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/400371259008/extension/400371259008/message-sync?syncType=FSync&recordCount=2&distinctConversations=true", "records" : [ { "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/400371259008/extension/400371259008/message-store/401060286008", "id" : 401060286008, "to" : [ { "phoneNumber" : "+16508783254" } ], "from" : { "phoneNumber" : "+18883770028" }, "type" : "SMS", "creationTime" : "2015-11-18T14:14:37.000Z", "readStatus" : "Read", "priority" : "Normal", "attachments" : [ { "id" : 401060286008, "uri" : "https://media.ringcentral.com/restapi/v1.0/account/400371259008/extension/400371259008/message-store/401060286008/content/401060286008", "type" : "Text", "contentType" : "text/plain" } ], "direction" : "Outbound", "availability" : "Alive", "subject" : "Test SMS message from Platform server", "messageStatus" : "Sent", "smsSendingAttemptsCount" : 1, "conversationId" : 1817157275107994090, "lastModifiedTime" : "2015-11-18T14:14:38.166Z" }, { "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/400371259008/extension/400371259008/message-store/401060274008", "id" : 401060274008, "to" : [ { "phoneNumber" : "+16508783204" } ], "from" : { "phoneNumber" : "+18883770028" }, "type" : "SMS", "creationTime" : "2015-11-18T14:14:26.000Z", "readStatus" : "Read", "priority" : "Normal", "attachments" : [ { "id" : 401060274008, "uri" : "https://media.ringcentral.com/restapi/v1.0/account/400371259008/extension/400371259008/message-store/401060274008/content/401060274008", "type" : "Text", "contentType" : "text/plain" } ], "direction" : "Outbound", "availability" : "Alive", "subject" : "Test SMS message from Platform server", "messageStatus" : "Sent", "smsSendingAttemptsCount" : 1, "conversationId" : 2701081737197845093, "lastModifiedTime" : "2015-11-18T14:14:26.434Z" } ], "syncInfo" : { "syncType" : "FSync", "syncToken" : "AQEAAAAAAwAAAVEa8k3QBgAAAAIFAAABURrz6VoTAQgAAABdN_yWgAkBCgGwXNsj", "syncTime" : "2015-11-18T14:16:11.354Z", "olderRecordsExist" : false } } ``` -------------------------------- ### Get User Profile with PHP Source: https://developers.ringcentral.com/api-reference/Profile/readGlipPersonNew This PHP example illustrates fetching user profile data via the RingCentral SDK. Ensure you have installed the SDK using Composer and configured your credentials. ```php '; require('vendor/autoload.php'); $rcsdk = new RingCentral\SDK\SDK($_ENV['RC_CLIENT_ID'], $_ENV['RC_CLIENT_SECRET'], $_ENV['RC_SERVER_URL']); $platform = $rcsdk->platform(); $platform->login([ "jwt" => $_ENV['RC_JWT'] ]); $r = $platform->get("/team-messaging/v1/persons/{$personId}"); // PROCESS RESPONSE ?> ``` -------------------------------- ### List Sites using C# Source: https://developers.ringcentral.com/api-reference/Multi-Site/listSites This C# example shows how to list sites via the RingCentral SDK. Ensure your API credentials are set as environment variables. The account ID can be set to '~' to use the current account. ```C# // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // PATH PARAMETERS string accountId = ""; RestClient rc = new RestClient( Environment.GetEnvironmentVariable("RC_CLIENT_ID"), Environment.GetEnvironmentVariable("RC_CLIENT_SECRET"), Environment.GetEnvironmentVariable("RC_SERVER_URL") ); rc.Authorize( Environment.GetEnvironmentVariable("RC_JWT")).Wait(); var r = await rc.Restapi().Account(accountId).Sites().List(); // PROCESS RESPONSE ``` -------------------------------- ### Get API Versions using JavaScript Source: https://developers.ringcentral.com/api-reference/API-Info/readAPIVersion Shows how to retrieve API version data using the RingCentral JavaScript SDK. This example assumes you have the SDK installed and your authentication details are available. ```JavaScript // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // PATH PARAMETERS const apiVersion = ''; const SDK = require('ringcentral'); const rcsdk = new SDK({ 'server': process.env.RC_SERVER_URL, 'clientId': process.env.RC_CLIENT_ID, 'clientSecret': process.env.RC_CLIENT_SECRET }); const platform = rcsdk.platform(); platform.login({ jwt: process.env.RC_JWT }).then(() => { platform.get(`/restapi/${apiVersion}`).then((r) => { // PROCESS RESPONSE }); }); ``` -------------------------------- ### Create Subscription (Node.js) Source: https://developers.ringcentral.com/api-reference/Subscriptions/createSubscription This Node.js example shows how to create a subscription. It requires the 'ringcentral' npm package and uses environment variables for authentication credentials. ```javascript // https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below // POST BODY const body = { eventFilters: [ '', ], expiresIn: 000 }; const SDK = require('ringcentral'); const rcsdk = new SDK({ 'server': process.env.RC_SERVER_URL, 'clientId': process.env.RC_CLIENT_ID, 'clientSecret': process.env.RC_CLIENT_SECRET }); const platform = rcsdk.platform(); platform.login({ jwt: process.env.RC_JWT }).then(() => { platform.post(`/restapi/v1.0/subscription`, body).then((r) => { // PROCESS RESPONSE }); }); ``` -------------------------------- ### Get JWKS using RingCentral PHP SDK Source: https://developers.ringcentral.com/api-reference/OAuth-and-OIDC/authJwks This PHP example retrieves JWKS using the RingCentral SDK. Ensure the SDK is installed via Composer and credentials are set in environment variables. ```php platform(); $platform->login([ "jwt" => $_ENV['RC_JWT'] ]); $r = $platform->get("/restapi/oauth/jwks"); // PROCESS RESPONSE ?> ```