Cliquify

Error Responses

When an API request fails, a structured error object is returned containing:

  • code: a machine-readable error code for programmatic handling
  • message: a human-readable explanation of the issue
Example response:
{
  "code": "invalid_access_token",
  "message": "Access token is invalid"
}

Error Codes

Below is the list of all possible error codes returned by the Connect APIs:

internal_error
invalid_field
invalid_header_value
permission_denied
too_many_requests
not_found
bad_request_body
bad_http_method
bad_request_params
bad_query_params
endpoint_not_found
unsupported_version
invalid_access_token
revoked_access_token
missing_field
missing_scope
invalid_grant
invalid_request
invalid_client
unauthorized_client
unsupported_grant_type
invalid_scope
invalid_basic_header
invalid_file_format
unsupported_content_type
request_too_large
asset_not_found
max_limit_reached
permission_not_found
permission_exists
unauthorized_user
user_not_found

Handling Errors

Use the error code to implement robust, programmatic handling:

try {
  const response = await fetch('https://oauth.cliquify.me/api/templates', {
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
    }
  });

  if (!response.ok) {
    const error = await response.json();

    switch (error.code) {
      case 'invalid_access_token':
        redirectToLogin();
        break;
      case 'permission_denied':
        showPermissionError();
        break;
      case 'not_found':
        showNotFoundError();
        break;
      default:
        showGenericError(error.message);
    }
  }
} catch (err) {
  showNetworkError();
}

Troubleshooting Common Errors

Below are common errors with solutions:

Error Code What It Means How to Troubleshoot
invalid_access_token Access token is malformed, expired, or invalid. Ensure token format is correct. Request a new token using your client credentials.
missing_access_token No Bearer token provided in the Authorization header. Include Authorization: Bearer YOUR_ACCESS_TOKEN in the request header.
expired_access_token Access token has expired (tokens are valid for 30 days). Request a new token via POST /oauth/access-token with your client credentials.
permission_denied User lacks access to the resource. Notify the user or check permission scopes.
missing_scope Required scope not granted during auth. Update OAuth request to include missing scope and re-authorize.
not_found Resource doesn't exist or is inaccessible. Confirm ID and user access. Resource may have been deleted.
too_many_requests Rate limit exceeded. Implement exponential backoff and retry strategy.
bad_request_body Malformed or invalid request body. Check JSON format and required fields.
invalid_field One or more fields contain invalid data. Refer to API docs for correct field formats.
internal_error Unexpected server issue. Retry after delay.