List All Accounts
Use this endpoint for the Accounts method to list all accounts.
Optionally, you can use the FriendlyName parameter to filter by that exact FriendlyName.
This route is present to be API compatible with other providers. Note that, since authentication on SignalWire is specific to a Project, this endpoint will return a list that contains only the Project you are connecting as.
Parameters
| Parameter | |
|---|---|
FriendlyName Optional | Returns the accounts whose FriendlyName exactly matches the one provided. |
Request
- cURL
- Node.js
- C#
- Python
- Ruby
curl https://example.signalwire.com/api/laml/2010-04-01/Accounts.json \
-X GET \
-u "YourProjectID:YourAuthToken"
const { RestClient } = require('@signalwire/compatibility-api')
const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
client.api.accounts.each(accounts => console.log(accounts.sid));
using System;
using System.Collections.Generic;
using Twilio;
using Twilio.Rest.Api.V2010;
class Program
{
static void Main(string[] args)
{
TwilioClient.Init("YourProjectID", "YourAuthToken", new Dictionary<string, object> { ["signalwireSpaceUrl"] = "{SPACE}.signalwire.com" });
var accounts = AccountResource.Read();
foreach(var record in accounts)
{
Console.WriteLine(record.Sid);
}
}
}
from signalwire.rest import Client as signalwire_client
client = signalwire_client("YourProjectID", "YourAuthToken", signalwire_space_url = 'example.signalwire.com')
accounts = client.api.accounts.list()
for record in accounts:
print(record.sid)
require 'signalwire/sdk'
@client = Signalwire::REST::Client.new 'YourProjectID', 'YourAuthToken', signalwire_space_url: "example.signalwire.com"
accounts = @client.api.accounts.list
accounts.each do |record|
puts record.sid
end
Responses
200 OK
{
"first_page_uri": "/api/laml/2010-04-01/Accounts.json?PageSize=40&Page=0",
"end": 0,
"previous_page_uri": "/api/laml/2010-04-01/Accounts.json?PageSize=40&Page=0",
"accounts": [
{
"auth_token": "redacted",
"date_created": "Sat, 15 Sept 2018 10:00:00 +0000",
"date_updated": "Sun, 16 Sept 2018 20:00:00 +0000",
"friendly_name": "SubAccount",
"sid": "b3877c40-da60-4998-90ad-b792e98472af",
"status": "active",
"subresource_uris": {
"available_phone_numbers": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers.json",
"calls": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls.json",
"conferences": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Conferences.json",
"incoming_phone_numbers": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/IncomingPhoneNumbers.json",
"notifications": null,
"outgoing_caller_ids": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/OutgoingCallerIds.json",
"recordings": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Recordings.json",
"transcriptions": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Transcriptions.json",
"addresses": null,
"signing_keys": null,
"connect_apps": null,
"sip": null,
"authorized_connect_apps": null,
"usage": null,
"keys": null,
"applications": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Applications.json",
"short_codes": null,
"queues": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Queues.json",
"messages": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Messages.json"
},
"type": "Full",
"uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af.json"
}
],
"uri": "/api/laml/2010-04-01/Accounts.json?PageSize=40&Page=0",
"page_size": 40,
"start": 0,
"next_page_uri": "/api/laml/2010-04-01/Accounts.json?PageSize=40&Page=40",
"page": 0
}