Skip to content

Commit

Permalink
change bandwidth api url (#6747)
Browse files Browse the repository at this point in the history
Old bandwidth API URL is shutting down. Using the new URL.
  • Loading branch information
icehess authored Jan 11, 2022
1 parent cd49225 commit be4b260
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/kazoo_number_manager/src/carriers/knm_bandwidth2.erl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
).
-endif.

-define(BW2_BASE_URL, "https://api.inetwork.com/v1.0").
-define(BW2_BASE_URL, "https://dashboard.bandwidth.com/api").

-ifdef(TEST).
-define(BW2_ACCOUNT_ID, "eunit_testing_account").
Expand Down Expand Up @@ -289,7 +289,7 @@ process_site(Site) ->

-spec peers(binary()) -> 'ok'.
peers(SiteId) ->
{'ok', Xml} = api_get(url(["sippeers"])),
{'ok', Xml} = api_get(url(["sites/", ?BW2_SITE_ID, "/sippeers"])),
io:format("listing all peers for account ~p, site ~p~n", [?BW2_ACCOUNT_ID, SiteId]),
Peers = xmerl_xpath:string("SipPeers/SipPeer", Xml),
lists:foreach(fun process_peer/1, Peers),
Expand Down Expand Up @@ -332,13 +332,13 @@ api_get(Url) ->
Response = kz_http:get(Url, [], HTTPOptions),
handle_response(Response).
-else.
api_get("https://api.inetwork.com/v1.0/accounts/eunit_testing_account/availableNumbers?areaCode="++_) ->
api_get("https://dashboard.bandwidth.com/api/accounts/eunit_testing_account/availableNumbers?areaCode="++_) ->
Resp = knm_util:fixture("bandwidth2_find_by_npa_no_detail.xml"),
handle_response({'ok', 200, [], Resp});
api_get("https://api.inetwork.com/v1.0/accounts/eunit_testing_account/availableNumbers?tollFreeWildCardPattern="++_) ->
api_get("https://dashboard.bandwidth.com/api/accounts/eunit_testing_account/availableNumbers?tollFreeWildCardPattern="++_) ->
Resp = knm_util:fixture("bandwidth2_find_tollfree.xml"),
handle_response({'ok', 200, [], Resp});
api_get("https://api.inetwork.com/v1.0/accounts/eunit_testing_account/orders/" ++ _) ->
api_get("https://dashboard.bandwidth.com/api/accounts/eunit_testing_account/orders/" ++ _) ->
Resp = knm_util:fixture("bandwidth2_check_order.xml"),
handle_response({'ok', 200, [], Resp}).
-endif.
Expand All @@ -362,7 +362,7 @@ api_post(Url, Body) ->
Response = kz_http:post(Url, Headers, UnicodeBody, HTTPOptions),
handle_response(Response).
-else.
api_post("https://api.inetwork.com/v1.0/accounts/eunit_testing_account/orders", Body) ->
api_post("https://dashboard.bandwidth.com/api/accounts/eunit_testing_account/orders", Body) ->
_UnicodeBody = unicode:characters_to_binary(Body),
Resp = knm_util:fixture("bandwidth2_buy_a_number.xml"),
handle_response({'ok', 200, [], Resp}).
Expand Down

0 comments on commit be4b260

Please sign in to comment.