Errors

list_errors

Client.list_errors(size=None, **kwargs)

Get a list of errors

Parameters:size (int) – Used for pagination to indicate the size of each page requested for querying a list of items. If no value is specified the default value is 25. (Maximum value 1000)
Return type:types.GeneratorType
Returns:list of calls

Example: List all errors:

error_list = api.list_errors()

print(list(error_list))

# [{
#     'category':'unavailable',
#     'code'    :'number-allocator-unavailable',
#     'details':[
#         {
#             'id'   :'ued-eh3zn3dxgiin4y',
#             'name' :'requestPath',
#             'value':'availableNumbers/local'
#         },
#         {
#             'id'   :'ued-3fsdqiq',
#             'name' :'remoteAddress',
#             'value':'216.82.234.65'
#         },
#         {
#             'id'   :'ued-2r4t47bwi',
#             'name' :'requestMethod',
#             'value':'GET'
#         }
#     ],
#     'id'     :'ue-upvfv53xzca',
#     'message':'Cannot connect to the number allocator',
#     'time'   :'2016-03-28T18:31:33Z'
# },
# {
#     'category':'unavailable',
#     'code':'number-allocator-unavailable',
#     'details':[
#         {
#             'id':'ued-kntwx7vyotalci',
#             'name':'requestPath',
#             'value':'availableNumbers/local'
#         },
#         {
#             'id':'ued-b24vxpfskldq',
#             'name':'remoteAddress',
#             'value':'216.82.234.65'
#         },
#         {
#             'id':'ued-ww5rcgl7zm2ydi',
#             'name':'requestMethod',
#             'value':'GET'
#         }
#     ],
#     'id':'ue-pok2vg7kyuzaqq',
#     'message':'Cannot connect to the number allocator',
#     'time':'2016-03-28T18:31:33Z'
# }]

get_error

Client.get_error(error_id)

Get information about an error

Parameters:id – id of an error
Return type:dict
Returns:error information

Example: Get information of specific error:

error = api.get_error('ue-errorId')
print(error)

## {
##     'category':'unavailable',
##     'code'    :'number-allocator-unavailable',
##     'details' :[
##         {
##            'id'      :'ued-kntvyotalci',
##            'name'    :'requestPath',
##            'value'   :'availableNumbers/local'
##         },
##         {
##            'id'      :'ued-b2dq',
##            'name'    :'remoteAddress',
##            'value'   :'216.82.234.65'
##         },
##         {
##            'id'      :'ued-wzm2ydi',
##            'name'    :'requestMethod',
##            'value'   :'GET'
##         }
##     ],
##     'id'      :'ue-errorId',
##     'message' :'Cannot connect to the number allocator',
##     'time'    :'2016-03-28T18:31:33Z'
## }