phaxio 2.1.0.pre → 2.1.1

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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -17
  3. data/lib/phaxio/client.rb +14 -12
  4. data/lib/phaxio/config.rb +6 -4
  5. data/lib/phaxio/error.rb +1 -0
  6. data/lib/phaxio/resource.rb +11 -5
  7. data/lib/phaxio/resources/account.rb +1 -1
  8. data/lib/phaxio/resources/ata.rb +85 -19
  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 +12 -3
  21. data/spec/client_spec.rb +17 -0
  22. data/spec/phaxio_spec.rb +7 -1
  23. data/spec/resources/account_spec.rb +1 -7
  24. data/spec/resources/ata_spec.rb +207 -0
  25. data/spec/resources/fax_spec.rb +35 -103
  26. data/spec/resources/phax_code_spec.rb +10 -44
  27. data/spec/resources/phone_number_spec.rb +19 -30
  28. data/spec/resources/port_number_note_spec.rb +33 -0
  29. data/spec/resources/port_number_spec.rb +32 -0
  30. data/spec/resources/port_order_spec.rb +76 -0
  31. data/spec/resources/public/area_code_spec.rb +1 -1
  32. data/spec/resources/public/country_spec.rb +1 -7
  33. data/spec/resources/{callback_spec.rb → webhook_spec.rb} +8 -8
  34. data/spec/spec_helper.rb +1 -0
  35. data/spec/support/{vcr_cassettes/resources/account/status.yml → cassettes/account/get.yml} +7 -9
  36. data/spec/support/cassettes/ata/add_phone_number.yml +89 -0
  37. data/spec/support/{vcr_cassettes/resources/fax/resend.yml → cassettes/ata/create.yml} +12 -13
  38. data/spec/support/cassettes/ata/delete.yml +86 -0
  39. data/spec/support/cassettes/ata/get.yml +87 -0
  40. data/spec/support/cassettes/ata/list.yml +67 -0
  41. data/spec/support/{vcr_cassettes/resources/phax_code/get_id.yml → cassettes/ata/provisioning_urls.yml} +10 -13
  42. data/spec/support/cassettes/ata/reference.yml +87 -0
  43. data/spec/support/cassettes/ata/regenerate.yml +89 -0
  44. data/spec/support/cassettes/ata/remove_phone_number.yml +130 -0
  45. data/spec/support/cassettes/ata/update.yml +89 -0
  46. data/spec/support/{vcr_cassettes/resources/fax/create_for_cancel.yml → cassettes/fax/cancel.yml} +51 -11
  47. data/spec/support/{vcr_cassettes/resources/fax/create_for_reference.yml → cassettes/fax/create.yml} +11 -13
  48. data/spec/support/{vcr_cassettes/resources/fax/create.yml → cassettes/fax/delete.yml} +49 -11
  49. data/spec/support/{vcr_cassettes/resources/fax/create_for_delete.yml → cassettes/fax/delete_file.yml} +49 -11
  50. data/spec/support/cassettes/fax/file.yml +93 -0
  51. data/spec/support/{vcr_cassettes/resources/fax/create_for_download_file.yml → cassettes/fax/get.yml} +49 -11
  52. data/spec/support/{vcr_cassettes/resources → cassettes}/fax/list.yml +5 -7
  53. data/spec/support/cassettes/fax/reference.yml +88 -0
  54. data/spec/support/{vcr_cassettes/resources/fax/create_for_delete_file.yml → cassettes/fax/resend.yml} +51 -11
  55. data/spec/support/{vcr_cassettes/resources → cassettes}/fax/test_receive.yml +7 -9
  56. data/spec/support/{vcr_cassettes/resources → cassettes}/phax_code/create.yml +8 -10
  57. data/spec/support/{vcr_cassettes/resources → cassettes}/phax_code/create_png.yml +8 -10
  58. data/spec/support/cassettes/phax_code/get_by_id.yml +86 -0
  59. data/spec/support/{vcr_cassettes/resources/phax_code/get.yml → cassettes/phax_code/get_default.yml} +8 -10
  60. data/spec/support/{vcr_cassettes/resources/phax_code/get_png.yml → cassettes/phax_code/get_default_png.yml} +8 -10
  61. data/spec/support/cassettes/phax_code/get_png_by_id.yml +90 -0
  62. data/spec/support/{vcr_cassettes/resources → cassettes}/phone_number/create.yml +8 -10
  63. data/spec/support/{vcr_cassettes/resources → cassettes}/phone_number/get.yml +10 -12
  64. data/spec/support/cassettes/phone_number/list.yml +72 -0
  65. data/spec/support/cassettes/phone_number/reference.yml +45 -0
  66. data/spec/support/cassettes/phone_number/release.yml +86 -0
  67. data/spec/support/cassettes/port_number/get.yml +88 -0
  68. data/spec/support/cassettes/port_number_note/list.yml +88 -0
  69. data/spec/support/cassettes/port_order/create.yml +48 -0
  70. data/spec/support/cassettes/port_order/get.yml +91 -0
  71. data/spec/support/cassettes/port_order/list.yml +52 -0
  72. data/spec/support/{vcr_cassettes/resources/public/area_codes → cassettes/public/area_code}/list.yml +15 -17
  73. data/spec/support/{vcr_cassettes/resources → cassettes}/public/country/list.yml +5 -7
  74. data/spec/support/vcr.rb +24 -6
  75. metadata +115 -41
  76. data/spec/support/credentials.rb +0 -7
  77. data/spec/support/vcr_cassettes/resources/fax/cancel.yml +0 -47
  78. data/spec/support/vcr_cassettes/resources/fax/create_for_get.yml +0 -50
  79. data/spec/support/vcr_cassettes/resources/fax/create_for_resend.yml +0 -50
  80. data/spec/support/vcr_cassettes/resources/fax/delete.yml +0 -45
  81. data/spec/support/vcr_cassettes/resources/fax/delete_file.yml +0 -45
  82. data/spec/support/vcr_cassettes/resources/fax/file.yml +0 -50
  83. data/spec/support/vcr_cassettes/resources/fax/get.yml +0 -45
  84. data/spec/support/vcr_cassettes/resources/fax/reference.yml +0 -45
  85. data/spec/support/vcr_cassettes/resources/phax_code/get_id_png.yml +0 -50
  86. data/spec/support/vcr_cassettes/resources/phone_number/list.yml +0 -60
  87. data/spec/support/vcr_cassettes/resources/phone_number/release.yml +0 -45
@@ -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
+
@@ -7,10 +7,10 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
- Authorization:
11
- - Basic dGVzdC1hcGkta2V5OnRlc3QtYXBpLXNlY3JldA==
12
10
  User-Agent:
13
11
  - Faraday v1.3.0
12
+ Authorization:
13
+ - "<AUTH_HEADER>"
14
14
  response:
15
15
  status:
16
16
  code: 200
@@ -21,25 +21,23 @@ http_interactions:
21
21
  content-type:
22
22
  - application/json; charset=utf-8
23
23
  date:
24
- - Wed, 24 Feb 2021 19:38:10 GMT
24
+ - Thu, 04 Nov 2021 21:07:44 GMT
25
25
  etag:
26
- - W/"fdf78451cea62a6da8f7a06bb945480d"
26
+ - W/"ec3c8a9d370f99638f5670ec4ac6fc00"
27
27
  server:
28
28
  - nginx
29
29
  strict-transport-security:
30
30
  - max-age=15768000; preload
31
31
  x-request-id:
32
- - a07420ca-8a4f-4a40-aeab-076a41813577
32
+ - e9708d49-deff-443c-92cb-2d89a3ef7272
33
33
  x-robots-tag:
34
34
  - noindex, nofollow, nosnippet, noarchive
35
- x-runtime:
36
- - '0.022529'
37
35
  content-length:
38
36
  - '171'
39
37
  connection:
40
38
  - keep-alive
41
39
  body:
42
40
  encoding: UTF-8
43
- string: '{"success":true,"message":"Account status retrieved successfully","data":{"balance":8325,"faxes_today":{"sent":6,"received":8},"faxes_this_month":{"sent":6,"received":8}}}'
44
- recorded_at: Wed, 24 Feb 2021 19:37:23 GMT
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
45
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
@@ -2,15 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.phaxio.com/v2.1/faxes/253964881/resend
5
+ uri: https://api.phaxio.com/v2.1/atas
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ''
8
+ string: name=Test+ATA
9
9
  headers:
10
- Authorization:
11
- - Basic dGVzdC1hcGkta2V5OnRlc3QtYXBpLXNlY3JldA==
12
10
  User-Agent:
13
- - Faraday v1.3.0
11
+ - Faraday v1.9.3
12
+ Authorization:
13
+ - "<AUTH_HEADER>"
14
14
  Content-Type:
15
15
  - application/x-www-form-urlencoded
16
16
  response:
@@ -23,25 +23,24 @@ http_interactions:
23
23
  content-type:
24
24
  - application/json; charset=utf-8
25
25
  date:
26
- - Wed, 24 Feb 2021 18:56:11 GMT
26
+ - Wed, 19 Jan 2022 21:51:25 GMT
27
27
  etag:
28
- - W/"c913676c758ee5ebb4cd5c50e687d644"
28
+ - W/"2240be8a677db0228884851090387d4a"
29
29
  server:
30
30
  - nginx
31
31
  strict-transport-security:
32
32
  - max-age=15768000; preload
33
33
  x-request-id:
34
- - 456e2adb-ba4c-4aa6-8319-af3f263b6e3b
34
+ - ab1cf64f-12e5-4630-8ca6-337822616937
35
35
  x-robots-tag:
36
36
  - noindex, nofollow, nosnippet, noarchive
37
- x-runtime:
38
- - '0.417675'
39
37
  content-length:
40
- - '77'
38
+ - '328'
41
39
  connection:
42
40
  - keep-alive
43
41
  body:
44
42
  encoding: UTF-8
45
- string: '{"success":true,"message":"Fax queued for resending","data":{"id":253965118}}'
46
- recorded_at: Wed, 24 Feb 2021 18:55:24 GMT
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
47
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
@@ -2,15 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.phaxio.com/v2.1/phax_codes/-Y3jxX
5
+ uri: https://api.phaxio.com/v2.1/atas/provisioning_urls
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
- Authorization:
11
- - Basic dGVzdC1hcGkta2V5OnRlc3QtYXBpLXNlY3JldA==
12
10
  User-Agent:
13
- - Faraday v1.3.0
11
+ - Faraday v1.9.3
12
+ Authorization:
13
+ - "<AUTH_HEADER>"
14
14
  response:
15
15
  status:
16
16
  code: 200
@@ -21,26 +21,23 @@ http_interactions:
21
21
  content-type:
22
22
  - application/json; charset=utf-8
23
23
  date:
24
- - Wed, 24 Feb 2021 19:43:33 GMT
24
+ - Wed, 19 Jan 2022 22:33:14 GMT
25
25
  etag:
26
- - W/"78c920ebcae905a8a076a0af95923885"
26
+ - W/"9391d72e15448827eafbd9b139e0c6e8"
27
27
  server:
28
28
  - nginx
29
29
  strict-transport-security:
30
30
  - max-age=15768000; preload
31
31
  x-request-id:
32
- - 152a4709-21c0-4af8-a04c-edd33bfebc92
32
+ - 7a27e762-61be-49a1-a6ad-8b494c97fdd8
33
33
  x-robots-tag:
34
34
  - noindex, nofollow, nosnippet, noarchive
35
- x-runtime:
36
- - '0.015573'
37
35
  content-length:
38
- - '159'
36
+ - '311'
39
37
  connection:
40
38
  - keep-alive
41
39
  body:
42
40
  encoding: UTF-8
43
- string: '{"success":true,"message":"Info for PhaxCode","data":{"identifier":"-Y3jxX","created_at":"2017-11-06T02:57:46.000-06:00","metadata":"This
44
- is a test PhaxCode"}}'
45
- recorded_at: Wed, 24 Feb 2021 19:42:46 GMT
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
46
43
  recorded_with: VCR 6.0.0