phaxio 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +2 -1
  3. data/README.md +53 -20
  4. data/lib/phaxio/client.rb +46 -16
  5. data/lib/phaxio/config.rb +7 -5
  6. data/lib/phaxio/resource.rb +11 -5
  7. data/lib/phaxio/resources/account.rb +1 -1
  8. data/lib/phaxio/resources/ata.rb +285 -0
  9. data/lib/phaxio/resources/callback.rb +10 -56
  10. data/lib/phaxio/resources/fax.rb +11 -11
  11. data/lib/phaxio/resources/phax_code.rb +2 -2
  12. data/lib/phaxio/resources/phone_number.rb +31 -5
  13. data/lib/phaxio/resources/port_number.rb +42 -0
  14. data/lib/phaxio/resources/port_number_note.rb +51 -0
  15. data/lib/phaxio/resources/port_order.rb +172 -0
  16. data/lib/phaxio/resources/public/area_code.rb +1 -1
  17. data/lib/phaxio/resources/public/country.rb +1 -1
  18. data/lib/phaxio/resources/webhook.rb +65 -0
  19. data/lib/phaxio/version.rb +1 -1
  20. data/lib/phaxio.rb +13 -3
  21. data/phaxio.gemspec +2 -1
  22. data/spec/client_spec.rb +38 -6
  23. data/spec/phaxio_spec.rb +7 -1
  24. data/spec/resources/account_spec.rb +1 -7
  25. data/spec/resources/ata_spec.rb +207 -0
  26. data/spec/resources/fax_spec.rb +42 -89
  27. data/spec/resources/phax_code_spec.rb +26 -32
  28. data/spec/resources/phone_number_spec.rb +19 -30
  29. data/spec/resources/port_number_note_spec.rb +33 -0
  30. data/spec/resources/port_number_spec.rb +32 -0
  31. data/spec/resources/port_order_spec.rb +76 -0
  32. data/spec/resources/public/area_code_spec.rb +1 -1
  33. data/spec/resources/public/country_spec.rb +1 -7
  34. data/spec/resources/{callback_spec.rb → webhook_spec.rb} +8 -8
  35. data/spec/spec_helper.rb +1 -0
  36. data/spec/support/{vcr_cassettes/resources/account/status.yml → cassettes/account/get.yml} +13 -14
  37. data/spec/support/cassettes/ata/add_phone_number.yml +89 -0
  38. data/spec/support/cassettes/ata/create.yml +46 -0
  39. data/spec/support/cassettes/ata/delete.yml +86 -0
  40. data/spec/support/cassettes/ata/get.yml +87 -0
  41. data/spec/support/cassettes/ata/list.yml +67 -0
  42. data/spec/support/cassettes/ata/provisioning_urls.yml +43 -0
  43. data/spec/support/cassettes/ata/reference.yml +87 -0
  44. data/spec/support/cassettes/ata/regenerate.yml +89 -0
  45. data/spec/support/cassettes/ata/remove_phone_number.yml +130 -0
  46. data/spec/support/cassettes/ata/update.yml +89 -0
  47. data/spec/support/cassettes/fax/cancel.yml +90 -0
  48. data/spec/support/cassettes/fax/create.yml +48 -0
  49. data/spec/support/cassettes/fax/delete.yml +88 -0
  50. data/spec/support/cassettes/fax/delete_file.yml +88 -0
  51. data/spec/support/cassettes/fax/file.yml +93 -0
  52. data/spec/support/cassettes/fax/get.yml +88 -0
  53. data/spec/support/cassettes/fax/list.yml +49 -0
  54. data/spec/support/cassettes/fax/reference.yml +88 -0
  55. data/spec/support/cassettes/fax/resend.yml +90 -0
  56. data/spec/support/cassettes/fax/test_receive.yml +49 -0
  57. data/spec/support/{vcr_cassettes/resources/fax/resend.yml → cassettes/phax_code/create.yml} +14 -15
  58. data/spec/support/cassettes/phax_code/create_png.yml +50 -0
  59. data/spec/support/cassettes/phax_code/get_by_id.yml +86 -0
  60. data/spec/support/{vcr_cassettes/resources/fax/delete.yml → cassettes/phax_code/get_default.yml} +14 -15
  61. data/spec/support/cassettes/phax_code/get_default_png.yml +48 -0
  62. data/spec/support/cassettes/phax_code/get_png_by_id.yml +90 -0
  63. data/spec/support/{vcr_cassettes/resources → cassettes}/phone_number/create.yml +15 -16
  64. data/spec/support/cassettes/phone_number/get.yml +44 -0
  65. data/spec/support/cassettes/phone_number/list.yml +72 -0
  66. data/spec/support/cassettes/phone_number/reference.yml +45 -0
  67. data/spec/support/cassettes/phone_number/release.yml +86 -0
  68. data/spec/support/cassettes/port_number/get.yml +88 -0
  69. data/spec/support/cassettes/port_number_note/list.yml +88 -0
  70. data/spec/support/cassettes/port_order/create.yml +48 -0
  71. data/spec/support/cassettes/port_order/get.yml +91 -0
  72. data/spec/support/cassettes/port_order/list.yml +52 -0
  73. data/spec/support/{vcr_cassettes/resources/public/area_codes → cassettes/public/area_code}/list.yml +18 -18
  74. data/spec/support/{vcr_cassettes/resources → cassettes}/public/country/list.yml +14 -15
  75. data/spec/support/files/test.txt +1 -0
  76. data/spec/support/vcr.rb +25 -8
  77. metadata +125 -31
  78. data/spec/support/credentials.rb +0 -7
  79. data/spec/support/vcr_cassettes/resources/fax/cancel.yml +0 -46
  80. data/spec/support/vcr_cassettes/resources/fax/create.yml +0 -230
  81. data/spec/support/vcr_cassettes/resources/fax/delete_file.yml +0 -44
  82. data/spec/support/vcr_cassettes/resources/fax/file.yml +0 -251
  83. data/spec/support/vcr_cassettes/resources/fax/get.yml +0 -44
  84. data/spec/support/vcr_cassettes/resources/fax/list.yml +0 -56
  85. data/spec/support/vcr_cassettes/resources/fax/test_receive.yml +0 -231
  86. data/spec/support/vcr_cassettes/resources/phax_code/create.yml +0 -100
  87. data/spec/support/vcr_cassettes/resources/phax_code/get.yml +0 -190
  88. data/spec/support/vcr_cassettes/resources/phone_number/get.yml +0 -45
  89. data/spec/support/vcr_cassettes/resources/phone_number/list.yml +0 -52
  90. data/spec/support/vcr_cassettes/resources/phone_number/release.yml +0 -44
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe PortNumber do
4
+ describe 'getting information about a number', vcr: 'port_number/get' do
5
+ let(:action) { PortNumber.get id, params }
6
+ let(:id) {
7
+ PortOrder.create(
8
+ port_numbers: [TEST_NUMBER],
9
+ contact_number: TEST_NUMBER,
10
+ contact_email: 'julien@phaxio.com',
11
+ account_identifier: '1234',
12
+ name_on_account: 'THIS IS A TEST',
13
+ provider_name: 'DO NOT PORT --Julien',
14
+ has_bill: true,
15
+ legal_agreement: true,
16
+ port_type: 'residential',
17
+ esig: 'NOT A VALID SIGNATURE'
18
+ ).port_numbers[0].id
19
+ }
20
+ let(:params) { {} }
21
+
22
+ it 'makes the request to phaxio' do
23
+ expect_api_request :get, "port_numbers/#{id}", params
24
+ action
25
+ end
26
+
27
+ it 'returns a port number object' do
28
+ result = action
29
+ expect(result).to be_a(PortNumber)
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,76 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe PortOrder do
4
+ describe 'creating an order', vcr: 'port_order/create' do
5
+ let(:action) { PortOrder.create params }
6
+ let(:params) {
7
+ {
8
+ port_numbers: [TEST_NUMBER],
9
+ contact_number: TEST_NUMBER,
10
+ contact_email: 'julien@phaxio.com',
11
+ account_identifier: '1234',
12
+ name_on_account: 'THIS IS A TEST',
13
+ provider_name: 'DO NOT PORT --Julien',
14
+ has_bill: true,
15
+ legal_agreement: true,
16
+ port_type: 'residential',
17
+ esig: 'NOT A VALID SIGNATURE'
18
+ }
19
+ }
20
+
21
+ it 'makes the request to Phaxio' do
22
+ expect_api_request :post, 'port_orders', params
23
+ action
24
+ end
25
+
26
+ it 'returns a port order object' do
27
+ result = action
28
+ expect(result).to be_a(PortOrder)
29
+ end
30
+ end
31
+
32
+ describe 'getting information about an order', vcr: 'port_order/get' do
33
+ let(:action) { PortOrder.get id, params }
34
+ let(:id) {
35
+ PortOrder.create(
36
+ port_numbers: [TEST_NUMBER],
37
+ contact_number: TEST_NUMBER,
38
+ contact_email: 'julien@phaxio.com',
39
+ account_identifier: '1234',
40
+ name_on_account: 'THIS IS A TEST',
41
+ provider_name: 'DO NOT PORT --Julien',
42
+ has_bill: true,
43
+ legal_agreement: true,
44
+ port_type: 'residential',
45
+ esig: 'NOT A VALID SIGNATURE'
46
+ ).id
47
+ }
48
+ let(:params) { {} }
49
+
50
+ it 'makes the request to Phaxio' do
51
+ expect_api_request :get, "port_orders/#{id}", params
52
+ action
53
+ end
54
+
55
+ it 'returns a port order object' do
56
+ result = action
57
+ expect(result).to be_a(PortOrder)
58
+ end
59
+ end
60
+
61
+ describe 'listing port orders', vcr: 'port_order/list' do
62
+ let(:action) { PortOrder.list params }
63
+ let(:params) { {} }
64
+
65
+ it 'makes the request to Phaxio' do
66
+ expect_api_request :get, 'port_orders', params
67
+ action
68
+ end
69
+
70
+ it 'returns a collection of port order objects' do
71
+ result = action
72
+ expect(result).to be_a(Phaxio::Resource::Collection)
73
+ expect(result.first).to be_a(PortOrder)
74
+ end
75
+ end
76
+ end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe Public::AreaCode do
4
- describe 'listing area codes available for purchasing numbers' do
4
+ describe 'listing area codes available for purchasing numbers', vcr: 'public/area_code/list' do
5
5
  let(:action) { Public::AreaCode.list params }
6
6
  let(:params) { {} }
7
7
 
@@ -1,16 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe Public::Country do
4
- describe 'getting a list of supported countries' do
4
+ describe 'getting a list of supported countries', vcr: 'public/country/list' do
5
5
  let(:action) { Public::Country.list }
6
6
  let(:params) { {} }
7
7
 
8
- around do |example|
9
- VCR.use_cassette('resources/public/country/list') do
10
- example.run
11
- end
12
- end
13
-
14
8
  it 'makes the request to Phaxio' do
15
9
  expect_api_request :get, 'public/countries', params
16
10
  action
@@ -1,18 +1,18 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe Callback do
4
- describe 'validating a callback signature' do
5
- let(:action) { Callback.valid_signature? signature, url, params, files }
6
- let(:signature) { '663099785e5eff09f0cd6f2bd5d78c852f3b670d' }
3
+ RSpec.describe Webhook do
4
+ describe 'validating a webhook signature' do
5
+ let(:action) { Webhook.valid_signature? signature, url, params, files }
6
+ let(:signature) { '64a735ef0c47a0ae671e381c046648f0966deb29' }
7
7
  let(:url) { 'example.com' }
8
8
  let(:params) { {test: true} }
9
9
  let(:files) { [] }
10
10
 
11
- it 'raises an error if Phaxio::Config.callback_token is unset' do
12
- Phaxio.callback_token = nil
11
+ it 'raises an error if Phaxio::Config.webhook_token is unset' do
12
+ Phaxio.webhook_token = nil
13
13
  expect {
14
14
  action
15
- }.to raise_error(Phaxio::Error::PhaxioError, 'No callback token has been set')
15
+ }.to raise_error(Phaxio::Error::PhaxioError, 'No webhook token has been set')
16
16
  end
17
17
 
18
18
  context 'signature matches' do
@@ -31,4 +31,4 @@ RSpec.describe Callback do
31
31
  end
32
32
  end
33
33
  end
34
- end
34
+ end
data/spec/spec_helper.rb CHANGED
@@ -4,3 +4,4 @@ require File.expand_path(File.join(['..', '..', 'lib', 'phaxio']), __FILE__)
4
4
  Dir[File.expand_path(File.join(['..', 'support', '**', '*.rb']), __FILE__)].each { |file| require file }
5
5
 
6
6
  include Phaxio::Resources
7
+
@@ -2,43 +2,42 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.phaxio.com/v2/account/status?api_key=<API_KEY>&api_secret=<API_SECRET>
5
+ uri: https://api.phaxio.com/v2.1/account/status
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.13.1
11
+ - Faraday v1.3.0
12
+ Authorization:
13
+ - "<AUTH_HEADER>"
12
14
  response:
13
15
  status:
14
16
  code: 200
15
- message:
17
+ message: OK
16
18
  headers:
17
19
  cache-control:
18
20
  - max-age=0, private, must-revalidate
19
21
  content-type:
20
22
  - application/json; charset=utf-8
21
23
  date:
22
- - Tue, 31 Oct 2017 03:07:02 GMT
24
+ - Thu, 04 Nov 2021 21:07:44 GMT
23
25
  etag:
24
- - W/"97e961f35ce919cc15be5de8e77175d7"
26
+ - W/"ec3c8a9d370f99638f5670ec4ac6fc00"
25
27
  server:
26
28
  - nginx
27
29
  strict-transport-security:
28
30
  - max-age=15768000; preload
29
31
  x-request-id:
30
- - 87f6ebc0-8f82-4e7e-87c9-5d53d2e505cb
32
+ - e9708d49-deff-443c-92cb-2d89a3ef7272
31
33
  x-robots-tag:
32
34
  - noindex, nofollow, nosnippet, noarchive
33
- x-runtime:
34
- - '0.036786'
35
35
  content-length:
36
- - '172'
36
+ - '171'
37
37
  connection:
38
- - Close
38
+ - keep-alive
39
39
  body:
40
40
  encoding: UTF-8
41
- string: '{"success":true,"message":"Account status retrieved successfully","data":{"balance":810,"faxes_today":{"sent":5,"received":5},"faxes_this_month":{"sent":13,"received":18}}}'
42
- http_version:
43
- recorded_at: Tue, 31 Oct 2017 03:07:02 GMT
44
- recorded_with: VCR 3.0.3
41
+ string: '{"success":true,"message":"Account status retrieved successfully","data":{"balance":1076,"faxes_today":{"sent":0,"received":0},"faxes_this_month":{"sent":0,"received":0}}}'
42
+ recorded_at: Thu, 04 Nov 2021 21:08:25 GMT
43
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,89 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.phaxio.com/v2.1/atas
6
+ body:
7
+ encoding: UTF-8
8
+ string: name=Test+ATA
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v1.9.3
12
+ Authorization:
13
+ - "<AUTH_HEADER>"
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ cache-control:
22
+ - max-age=0, private, must-revalidate
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ date:
26
+ - Wed, 19 Jan 2022 22:12:30 GMT
27
+ etag:
28
+ - W/"82571b1034afcee79226b4fcc50a748d"
29
+ server:
30
+ - nginx
31
+ strict-transport-security:
32
+ - max-age=15768000; preload
33
+ x-request-id:
34
+ - 95982f46-ea73-4e72-9093-d01dbff82bba
35
+ x-robots-tag:
36
+ - noindex, nofollow, nosnippet, noarchive
37
+ content-length:
38
+ - '328'
39
+ connection:
40
+ - keep-alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"success":true,"message":"ATA created successfully","data":{"id":346,"name":"Test
44
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null,"username":"6y552s8hr6","password":"1scqoev0h78am502"}}'
45
+ recorded_at: Wed, 19 Jan 2022 22:13:14 GMT
46
+ - request:
47
+ method: post
48
+ uri: https://api.phaxio.com/v2.1/atas/346/phone_numbers/+15558675309
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ headers:
53
+ User-Agent:
54
+ - Faraday v1.9.3
55
+ Authorization:
56
+ - "<AUTH_HEADER>"
57
+ Content-Type:
58
+ - application/x-www-form-urlencoded
59
+ response:
60
+ status:
61
+ code: 200
62
+ message: OK
63
+ headers:
64
+ cache-control:
65
+ - max-age=0, private, must-revalidate
66
+ content-type:
67
+ - application/json; charset=utf-8
68
+ date:
69
+ - Wed, 19 Jan 2022 22:12:30 GMT
70
+ etag:
71
+ - W/"45b7a68a0761a863f4ece867e2665df8"
72
+ server:
73
+ - nginx
74
+ strict-transport-security:
75
+ - max-age=15768000; preload
76
+ x-request-id:
77
+ - eaf09fe8-0544-4c6b-b7a8-2384c99a22e0
78
+ x-robots-tag:
79
+ - noindex, nofollow, nosnippet, noarchive
80
+ content-length:
81
+ - '96'
82
+ connection:
83
+ - keep-alive
84
+ body:
85
+ encoding: UTF-8
86
+ string: '{"success":true,"message":"Phone number added to ATA","data":{"phone_number":"+1
87
+ 318-225-8808"}}'
88
+ recorded_at: Wed, 19 Jan 2022 22:13:14 GMT
89
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.phaxio.com/v2.1/atas
6
+ body:
7
+ encoding: UTF-8
8
+ string: name=Test+ATA
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v1.9.3
12
+ Authorization:
13
+ - "<AUTH_HEADER>"
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ cache-control:
22
+ - max-age=0, private, must-revalidate
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ date:
26
+ - Wed, 19 Jan 2022 21:51:25 GMT
27
+ etag:
28
+ - W/"2240be8a677db0228884851090387d4a"
29
+ server:
30
+ - nginx
31
+ strict-transport-security:
32
+ - max-age=15768000; preload
33
+ x-request-id:
34
+ - ab1cf64f-12e5-4630-8ca6-337822616937
35
+ x-robots-tag:
36
+ - noindex, nofollow, nosnippet, noarchive
37
+ content-length:
38
+ - '328'
39
+ connection:
40
+ - keep-alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"success":true,"message":"ATA created successfully","data":{"id":332,"name":"Test
44
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null,"username":"s5beofdgwn","password":"y6wt3q215qsec25i"}}'
45
+ recorded_at: Wed, 19 Jan 2022 21:52:09 GMT
46
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,86 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.phaxio.com/v2.1/atas
6
+ body:
7
+ encoding: UTF-8
8
+ string: name=Test+ATA
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v1.9.3
12
+ Authorization:
13
+ - "<AUTH_HEADER>"
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ cache-control:
22
+ - max-age=0, private, must-revalidate
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ date:
26
+ - Wed, 19 Jan 2022 22:03:49 GMT
27
+ etag:
28
+ - W/"536d2044c4783d836261ec6017185c3f"
29
+ server:
30
+ - nginx
31
+ strict-transport-security:
32
+ - max-age=15768000; preload
33
+ x-request-id:
34
+ - 1177e98e-ce7e-461e-bed7-b8068464e9bb
35
+ x-robots-tag:
36
+ - noindex, nofollow, nosnippet, noarchive
37
+ content-length:
38
+ - '328'
39
+ connection:
40
+ - keep-alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"success":true,"message":"ATA created successfully","data":{"id":342,"name":"Test
44
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null,"username":"fd16l2dg33","password":"qsfpji7yzwn9laxn"}}'
45
+ recorded_at: Wed, 19 Jan 2022 22:04:32 GMT
46
+ - request:
47
+ method: delete
48
+ uri: https://api.phaxio.com/v2.1/atas/342
49
+ body:
50
+ encoding: US-ASCII
51
+ string: ''
52
+ headers:
53
+ User-Agent:
54
+ - Faraday v1.9.3
55
+ Authorization:
56
+ - "<AUTH_HEADER>"
57
+ response:
58
+ status:
59
+ code: 200
60
+ message: OK
61
+ headers:
62
+ cache-control:
63
+ - max-age=0, private, must-revalidate
64
+ content-type:
65
+ - application/json; charset=utf-8
66
+ date:
67
+ - Wed, 19 Jan 2022 22:03:49 GMT
68
+ etag:
69
+ - W/"b5f064faa0e68681d9afb0081d56421d"
70
+ server:
71
+ - nginx
72
+ strict-transport-security:
73
+ - max-age=15768000; preload
74
+ x-request-id:
75
+ - c3a36e16-b27d-4b23-a1e6-bac3055b216c
76
+ x-robots-tag:
77
+ - noindex, nofollow, nosnippet, noarchive
78
+ content-length:
79
+ - '71'
80
+ connection:
81
+ - keep-alive
82
+ body:
83
+ encoding: UTF-8
84
+ string: '{"success":true,"message":"ATA deleted successfully","data":{"id":342}}'
85
+ recorded_at: Wed, 19 Jan 2022 22:04:33 GMT
86
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,87 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.phaxio.com/v2.1/atas
6
+ body:
7
+ encoding: UTF-8
8
+ string: name=Test+ATA
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v1.9.3
12
+ Authorization:
13
+ - "<AUTH_HEADER>"
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ cache-control:
22
+ - max-age=0, private, must-revalidate
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ date:
26
+ - Wed, 19 Jan 2022 21:54:07 GMT
27
+ etag:
28
+ - W/"a3c740cf3c3bb7dc34d987d8b41c1841"
29
+ server:
30
+ - nginx
31
+ strict-transport-security:
32
+ - max-age=15768000; preload
33
+ x-request-id:
34
+ - 02a1c44f-2e79-42ad-a920-2d1d570ca5dd
35
+ x-robots-tag:
36
+ - noindex, nofollow, nosnippet, noarchive
37
+ content-length:
38
+ - '328'
39
+ connection:
40
+ - keep-alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"success":true,"message":"ATA created successfully","data":{"id":335,"name":"Test
44
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null,"username":"x8353ormng","password":"12aiz5blteavkbn8"}}'
45
+ recorded_at: Wed, 19 Jan 2022 21:54:50 GMT
46
+ - request:
47
+ method: get
48
+ uri: https://api.phaxio.com/v2.1/atas/335
49
+ body:
50
+ encoding: US-ASCII
51
+ string: ''
52
+ headers:
53
+ User-Agent:
54
+ - Faraday v1.9.3
55
+ Authorization:
56
+ - "<AUTH_HEADER>"
57
+ response:
58
+ status:
59
+ code: 200
60
+ message: OK
61
+ headers:
62
+ cache-control:
63
+ - max-age=0, private, must-revalidate
64
+ content-type:
65
+ - application/json; charset=utf-8
66
+ date:
67
+ - Wed, 19 Jan 2022 21:54:07 GMT
68
+ etag:
69
+ - W/"199f50771716f15604878796c84a7376"
70
+ server:
71
+ - nginx
72
+ strict-transport-security:
73
+ - max-age=15768000; preload
74
+ x-request-id:
75
+ - 91959a41-e55f-4b6d-98ef-5d7a357ccd0d
76
+ x-robots-tag:
77
+ - noindex, nofollow, nosnippet, noarchive
78
+ content-length:
79
+ - '266'
80
+ connection:
81
+ - keep-alive
82
+ body:
83
+ encoding: UTF-8
84
+ string: '{"success":true,"message":"Metadata for ATA","data":{"id":335,"name":"Test
85
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null}}'
86
+ recorded_at: Wed, 19 Jan 2022 21:54:51 GMT
87
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,67 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.phaxio.com/v2.1/atas
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v1.9.3
12
+ Authorization:
13
+ - "<AUTH_HEADER>"
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ cache-control:
20
+ - max-age=0, private, must-revalidate
21
+ content-type:
22
+ - application/json; charset=utf-8
23
+ date:
24
+ - Wed, 19 Jan 2022 22:25:30 GMT
25
+ etag:
26
+ - W/"27973b206337bb31cc316040ad40aa86"
27
+ server:
28
+ - nginx
29
+ strict-transport-security:
30
+ - max-age=15768000; preload
31
+ x-page:
32
+ - '1'
33
+ x-per-page:
34
+ - '25'
35
+ x-request-id:
36
+ - a9eed52a-a354-4f3d-8488-f10e6aa31df6
37
+ x-robots-tag:
38
+ - noindex, nofollow, nosnippet, noarchive
39
+ x-total:
40
+ - '19'
41
+ content-length:
42
+ - '4174'
43
+ connection:
44
+ - keep-alive
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"success":true,"message":"Retrieved ATAs successfully","data":[{"id":297,"name":"asdf","description":"asdf","user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":332,"name":"Test
48
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":333,"name":"Test
49
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":334,"name":"Test
50
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":335,"name":"Test
51
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":336,"name":"Test
52
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":337,"name":"Test
53
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":338,"name":"New
54
+ Name","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":339,"name":"Test
55
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":340,"name":"Test
56
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":341,"name":"Test
57
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":343,"name":"Test
58
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":344,"name":"Test
59
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":345,"name":"Test
60
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":346,"name":"Test
61
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":347,"name":"Test
62
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":348,"name":"Test
63
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":349,"name":"Test
64
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null},{"id":350,"name":"Test
65
+ ATA","description":null,"user_phone_number":null,"domain":"ata.staging.phaxio.com","last_registered":null,"expiry_time":null,"user_agent":null,"sip_uri":null,"mac_address":null,"group":null}],"paging":{"total":19,"per_page":25,"page":1}}'
66
+ recorded_at: Wed, 19 Jan 2022 22:26:14 GMT
67
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,43 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.phaxio.com/v2.1/atas/provisioning_urls
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v1.9.3
12
+ Authorization:
13
+ - "<AUTH_HEADER>"
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ cache-control:
20
+ - max-age=0, private, must-revalidate
21
+ content-type:
22
+ - application/json; charset=utf-8
23
+ date:
24
+ - Wed, 19 Jan 2022 22:33:14 GMT
25
+ etag:
26
+ - W/"9391d72e15448827eafbd9b139e0c6e8"
27
+ server:
28
+ - nginx
29
+ strict-transport-security:
30
+ - max-age=15768000; preload
31
+ x-request-id:
32
+ - 7a27e762-61be-49a1-a6ad-8b494c97fdd8
33
+ x-robots-tag:
34
+ - noindex, nofollow, nosnippet, noarchive
35
+ content-length:
36
+ - '311'
37
+ connection:
38
+ - keep-alive
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"success":true,"message":"Retrieved provisioning URLs","data":{"Grandstream":"provision.staging.phaxio.com/test-ata-provisioning-key","OBi":"https://provision.staging.phaxio.com/test-ata-provisioning-key/$MAC.xml","Netgen":"https://provision.staging.phaxio.com/test-ata-provisioning-key"}}'
42
+ recorded_at: Wed, 19 Jan 2022 22:33:57 GMT
43
+ recorded_with: VCR 6.0.0