API Schema
This guide covers the How2Validate API response Schema.
Schema
{
"status": 200,4xx,5xx,
"app": "How2Validate",
"data": {
"validate": {
"state": "Active/InActive",
"message": "The provided secret 'npm_access_token' is currently inactive and not operational.",
"response": {},
"report": "email@how2validate.com"
},
"provider": "npm",
"services": "npm_access_token"
},
"error": {
"message": "Invalid token provided for 'npm_access_token'."
},
"timestamp": "2024-10-21T08:59:53.986903+00:00"
}
Fields Explanation
-
status (int): The HTTP status code of the validation result. It indicates whether the validation was successful or if there was an error.- 200: Success.
- 4xx: Client-side error (e.g., invalid token, missing parameter).
- 5xx: Server-side error (e.g., external provider API is down).
-
app (str): The name of the application performing the validation."How2Validate" -
data (object): Contains detailed information about the validation process if the validation was successful.-
validate (object): Holds information about the validation process, such as the state of the secret or token and any related message or response data.-
state (str): The state of the validation process. Possible values are:- Active: The secret is valid and operational.
- InActive: The secret is invalid or expired.
-
message (str): A message providing more details about the validation process. For example: "The provided secret 'npm_access_token' is currently active and operational." -
response (Any): The response data obtained from the validation, often returned from the provider's API. It could be a JSON object or a string representation of the response. -
report (str): An optional email address where a report or additional details about the validation can be sent (e.g., "email@how2validate.com").
-
-
provider (str): The name of the provider being validated (e.g., "npm"). -
services (str): The service or token that was validated (e.g., "npm_access_token").
-
-
error (object): Contains error information if the validation failed.message (str): A human-readable error message explaining why the validation failed.
-
timestamp (str): The timestamp when the validation occurred, in ISO 8601 format.
Sample response
Sample response for Status Code:
{
status: 200,
app: 'How2Validate',
data: {
validate: {
state: 'Active',
message: "The provided secret 'snyk_auth_key' is currently active and operational.",
response: '\n' +
'{\n' +
' "ok": true,\n' +
' "user": {\n' +
' "username": "vigneshkna",\n' +
' "name": "Vignesh Kannan",\n' +
' "email": "username@gmail.com",\n' +
' "created": "2023-05-03T16:17:52.134Z",\n' +
' "avatar": "https://s.gravatar.com/avatar/ac6f7273ac4ba125c2ece9?size=200&default=https%3A%2F%2Fres.clo.com%2Fsnyk%2Fimage%2Fupload%2Fv1533%2Fgravatar%2F_l.png",\n' +
' "id": "UserId",\n' +
' "orgs": []\n' +
' }\n' +
'}',
report: 'email@how2validate.com'
},
provider: 'snyk',
services: 'snyk_auth_key'
},
timestamp: '2024-10-21T14:26:54.996Z'
}