Infraon API Guide
Product DocsSchemaAuthentication
  • Welcome
    • Base URL
    • Authorization
    • Responses
  • Modules
    • Schema
    • Authentication
    • Announcement
    • API Registration
    • Async Tasks
    • BusinessRule
    • BusinessServiceConfiguration
    • Service Catalogue
    • CMDBBlacklistWhitelist
    • CMDBCategory
    • CMDBConsumables
    • Ux
    • CMDBSoftwareLicense
    • Cmdb
    • CMDBRelation
    • CMDBSoftware
    • ContractManagement
    • Department
    • Events
    • Field Configuration
    • IMACD
    • Knowledge Base
    • Leaves
    • Chat
    • Marketplace
    • APIViewSet
    • BeepViewSet
    • SMSviewset
    • Suppressedviewset
    • Organization Location
    • Partner
    • Predicted Events
    • Requester
    • Service Feasibility Requests
    • Role Profile
    • Tag
    • Service_outage
    • Teams
    • Telecom Settings
    • Trap Configurations
    • User Profile
    • Vendor Managemment
    • Association Events
    • Device Template
    • Discovery Configuration
    • Jobs
    • MIB Explorer
    • Seasonal Events
    • IPAM
    • Log Grok Pattern Configuration
    • Log Pipeline Configuration
    • Log Integraion
    • Log Search
    • CLI Download Jobs
    • Configuration Profiles
    • Configuration Policies
    • Configuration Rules
    • Configuration Search
    • Configuration Template
    • Configuration Trigger
    • Jobs Account Audit
    • Manage Vulnerabilities
    • OS Image Download
    • Rule Group
    • Configuration Upload Jobs
    • Work Flow Jobs
    • Change
    • Checklist
    • Incident
    • Problem
    • Release
    • Request Process
    • Task
    • Models
Powered by GitBook
On this page
  • 🟢 Success Responses
  • 📘 Example – 200 OK
  • 🔴 Error Responses
  • 💡 Common Error Scenarios
  • 🧪 Sample: Handling a 401 Error in Curl
  1. Welcome

Responses

PreviousAuthorizationNextSchema

Last updated 1 month ago

All API requests return standard HTTP status codes to indicate success or failure. In this section, you'll find explanations of success responses, error responses, and code examples to help you handle them properly.

🟢 Success Responses

When a request is processed successfully, the API returns one of the following status codes:

Status Code

Response

Description

200 OK

Success

The request was successful, and the server returns the requested data.

201 Created

Resource Created

The request was successful, and a new resource has been created (e.g., after a POST).

204 No Content

No Content

The request was successful, but there is no data to return (e.g., after DELETE).

📘 Example – 200 OK

{
"status": "success"
}

🔴 Error Responses

When something goes wrong, the API will return an appropriate error code and a message to help you debug the issue.

Status Code

Response Example

Description

400 Bad Request

{"error": "Please provide username."}

Your request is malformed—missing fields, invalid data types, or incorrect JSON.

401 Unauthorized

{"error": "Invalid API key."}

Authentication failed—API key is missing, incorrect, or expired.

403 Forbidden

{"error": "API key is missing."}

You don't have permission to access the resource.

500 Internal Server Error

{"error": "Something went wrong. Please try again later."}

A server-side error occurred. Contact support if the issue persists.

💡 Common Error Scenarios

Error Message

Likely Cause

Recommended Fix

Please provide username.

Missing username field in the request body

Ensure you're passing username as a string

Please provide password.

Missing password field

Include the password key in the request body

Invalid API key.

Wrong or expired API key

Verify your token and reauthenticate if needed

Incorrect username or password.

Login credentials are invalid

Double-check credentials or reset password

🧪 Sample: Handling a 401 Error in Curl

curl -X GET https://your-subdomain.api.infraon.app/api/user \
-H "Authorization: ApiKey INVALID_KEY"

Response

{
"error": "Invalid API key."
}

Always verify your request payload and headers before retrying. Use tools like Postman, Insomnia, or Swagger UI to test and debug effectively.