-
Notifications
You must be signed in to change notification settings - Fork 180
/
GenericErrorCodes.ts
136 lines (118 loc) · 4.55 KB
/
GenericErrorCodes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/**
* Enum representing the different types of generic error codes
* that might be returned by the Vonage APIs.
*/
export enum GenericErrors {
/**
* The account has insufficient funds. This request could not be performed
* due to your account balance being low. Top up your account in the Vonage
* Dashboard.
*/
LOW_BALANCE = 'low-balance',
/**
* The provided credentials are incorrect or missing. You did not provide
* correct credentials. Check your authentication credentials; they can be
* found in the Vonage Dashboard.
*/
UNAUTHORIZED = 'unauthorized',
/**
* The authenticated user does not have access to the requested resource. Your
* account does not have permission to perform this action. Check that you're
* using the correct credentials and that your account has this feature enabled.
*/
FORBIDDEN = 'forbidden',
/**
* The requested resource could not be found. The requested resource does not
* exist, or you do not have access to it. Check both the URI that you're
* requesting and your authentication credentials.
*/
NOT_FOUND = 'not-found',
/**
* The account is not provisioned for the requested service. The credentials
* provided do not have access to the requested product. Check that your API
* key is correct and has been whitelisted.
*/
UNPROVISIONED = 'unprovisioned',
/**
* The account has been suspended. This account has been suspended. Contact
* support@api.vonage.com for more information.
*/
ACCOUNT_SUSPENDED = 'account-suspended',
/**
* The provided JWT has expired. The JWT provided has expired. Generate a
* new JWT with an expiration date in the future.
*/
JWT_EXPIRED = 'jwt-expired',
/**
* The provided JWT has been revoked. The JWT provided has been revoked.
* Generate a new JWT using your private key.
*/
JWT_REVOKED = 'jwt-revoked',
/**
* The provided API key is invalid. The API key provided does not exist in
* our system, or you do not have access. Modify your request to provide a
* valid API key.
*/
INVALID_API_KEY = 'invalid-api-key',
/**
* The provided signature is invalid. The signature provided did not
* validate. Check your signature secret and ensure you're following the
* correct signing process.
*/
INVALID_SIGNATURE = 'invalid-signature',
/**
* The request originates from an unauthorized IP address. The source IP
* address of the request is not in our allow list. Make a request from an
* allowed IP address, or add your current IP to the list of authorized
* addresses.
*/
INVALID_IP = 'invalid-ip',
/**
* Multiple authentication methods were provided in the request.
* Provide exactly one authentication method.
*/
MULTIPLE_AUTH_METHODS = 'multiple-auth-methods',
/**
* The provided ID in the request is invalid. The ID provided does not exist
* in our system. Modify your request to provide a valid ID.
*/
INVALID_ID = 'invalid-id',
/**
* The provided JSON in the request body is invalid. The request body did
* not contain valid JSON. Send a JSON request body, including a
* Content-Type header of application/json.
*/
INVALID_JSON = 'invalid-json',
/**
* The HTTP verb used in the request is not allowed. This endpoint does not
* support the HTTP verb that you requested. Read the API documentation to
* see which verbs your desired endpoint supports.
*/
WRONG_VERB = 'wrong-verb',
/**
* The provided Accept header in the request is invalid. Invalid Accept
* header provided. Most Vonage APIs only send back application/json. Check
* the API documentation for the specific API you're working with for a
* complete list of supported data types.
*/
ACCEPT_HEADER = 'accept-header',
/**
* The provided Content-Type header in the request is invalid. Invalid
* Content-Type header provided. Most Vonage APIs only accept application/
* json. Check the API documentation for the specific API you're working
* with for a complete list of supported data types.
*/
CONTENT_TYPE_HEADER = 'content-type-header',
/**
* The requested service is unavailable due to legal reasons. Vonage APIs
* are unavailable in the following areas due to international sanctions:
* Sudan, Syria, Crimea, North Korea, Iran, and Cuba.
*/
UNAVAILABLE_LEGAL = 'unavailable-legal',
/**
* The application associated with the request has been suspended. This
* application has been suspended. Re-enable the application or create a new
* application to use.
*/
APPLICATION_SUSPENDED = 'application-suspended',
}