Closed noahsilas closed 3 years ago
Unrelated aside: it would be awesome if it was possible to deep link into https://dev.bandwidth.com/numbers/apiReference.html so I could link directly to the "Response" tab under the POST /accounts/{accountId}/tnoptions
endpoint (or even just that endpoint specifically)
Hey @noahsilas,
Taking a look at this today
as for deep linking to docs in the API reference - as soon as we have an Open API spec for that service (Soon, fingers crossed) we will generate new API documentation with deep linking that will look similar to this.
The response coming back from this endpoint has a different shape than the
TnOption.get()
- it is wrapped in a<TnOptionOrderResponse>
element. That element doesn't have any directTnOptionGroups
children, and so this method was throwing when trying to iterate over an undefined attribute (initem.tnOptionGroups.forEach(...)
).Adjusting the tests to use an XML response that matches the API documentation demonstrates the failure well: the tests time out, because the thrown error prevents the callback from firing.
The package documentation suggests that the shape of this response should match
TnOption.get()
, which we can achieve by just unwrapping the contents from that outermost<TnOptionOrderResponse>
element.