Skip to content
ADP
API Design PrincipleBETA

[ADP-49] API Term Registration

reviewing phase 1

  1. This article should provide an internal registration page but not yet.
  2. This article does not define the process of registration update yet.

Overview

This article tries to establish a unified API term registration process to ensure consistency and standardization of API-related terminology across the organization. The process is inspired by the IANA registration procedures, adapting them to our organizational context.

Notice: The following is a draft and may not be final. It is subject to change and should be treated as a work in progress. We may add more registration types in the future.

Standard Details

  1. Problem Type Registration

    • Definition: A process for registering new problem types used in API error responses.
    • Registration process MUST include: a. Proposal submission b. Review by API Governance Team c. Approval and addition to the official problem type registry
    • Documentation MUST include:
      • Problem type identifier
      • Description
      • Required attributes
      • Optional attributes
      • Example usage
  2. HTTP Custom Preference Registration

    • Definition: A process for registering custom HTTP preferences used in API requests.
    • Registration process MUST include: a. Proposal submission with justification b. Review for potential conflicts with existing standards c. Approval and documentation
    • Documentation MUST include:
      • Preference name
      • Description
      • Syntax
      • Intended use cases
  3. Application ID Registration (URN or Custom MIME Type)

    • Definition: A process for registering unique application identifiers, either as URNs or custom MIME types.
    • Registration process MUST include: a. Submission of application ID proposal b. Review for uniqueness and adherence to naming conventions c. Approval and addition to the organization's application ID registry
    • Documentation MUST include:
      • Application ID (URN or MIME type)
      • Description of the application
      • Version information (if applicable)
      • Usage guidelines
  4. Custom Header Registration

    • Definition: A process for registering custom HTTP headers used in API requests and responses.
    • Registration process MUST include: a. Proposal submission with justification b. Review for potential conflicts with existing standards c. Approval and documentation
    • Documentation MUST include:
      • Header name
      • Description
      • Syntax
      • Applicable to (Request, Response, or Both)
      • Usage guidelines
  5. Link Relation Registration

    • Definition: A process for registering link relation types used in API responses.
    • Registration process MUST include: a. Proposal submission with justification b. Review for potential conflicts with existing standards c. Approval and documentation
    • Documentation MUST include:
      • Relation name
      • Description
      • Reference
      • Usage guidelines
  6. Authorization Schema Registration

    • Definition: A process for registering authorization schemas used in API security.
    • Registration process MUST include: a. Proposal submission with justification and security considerations b. Review by API Governance Team and Security Team c. Approval and documentation
    • Documentation MUST include:
      • Schema name
      • Description
      • Token format (if applicable)
      • Header format
      • Required claims or parameters
      • Optional claims or parameters
      • Usage guidelines

Term Maintenance and Accessibility

  • The organization MUST maintain a central repository for all registered terms, problem types, preferences, and application IDs.
  • The organization MUST implement a regular review process to ensure all registered items remain relevant and up-to-date.
  • The organization MUST provide search and browsing capabilities for easy access to registered items.

Compliance

  • All API designs and implementations MUST use registered terms, problem types, preferences, and application IDs where applicable.

Responsibilities

  • API Governance Team SHALL oversee the registration processes, review submissions, and maintain the registries.
  • API Designers and Developers SHALL submit new items for registration and MUST use registered items in their work.
  • Documentation Team SHALL ensure consistent use of registered items in API documentation.

Example Registrations

Problem Type Registry

Problem TypeDescriptionRequired AttributesOptional AttributesExample Usage
https://api.example.com/problems/resource-not-foundIndicates that the requested resource does not existdetail, instancetitle{"type": "https://api.example.com/problems/resource-not-found", "title": "Resource Not Found", "detail": "The requested user with ID 12345 does not exist", "instance": "/users/12345"}
https://api.example.com/problems/invalid-inputIndicates that the provided input is invaliddetail, errorstitle, instance{"type": "https://api.example.com/problems/invalid-input", "title": "Invalid Input", "detail": "The provided data failed validation", "errors": [{"field": "email", "message": "Invalid email format"}]}

HTTP Custom Preference Registry

Preference NameDescriptionSyntaxIntended Use Cases
example-api-versionSpecifies the desired API versionexample-api-version=YYYY-MM-DDAllow clients to request specific API versions
example-response-formatSpecifies the desired response formatexample-response-format=(json|xml)Allow clients to request specific response formats

Application ID Registry

Application IDDescriptionVersionUsage Guidelines
urn:example:app:inventory-managementInventory Management Application1.0Use this URN to identify the Inventory Management Application in API requests and responses
application/vnd.example.user-profile+jsonCustom MIME type for user profile dataN/AUse this MIME type when sending or receiving user profile data in JSON format

Custom Header Registry

Header NameDescriptionSyntaxApplicable toUsage Guidelines
X-API-KeyUsed for API authenticationX-API-Key: <api_key>RequestInclude this header in all API requests for authentication purposes
X-Rate-Limit-RemainingIndicates the number of requests remaining in the current rate limit windowX-Rate-Limit-Remaining: <integer>ResponseCheck this header in API responses to manage request rates and avoid exceeding limits
X-Request-IDUnique identifier for the request, used for tracing and debuggingX-Request-ID: <uuid>BothGenerate a unique ID for each request and include it in both the request and response headers for tracing purposes
Relation NameDescriptionReferenceUsage Guidelines
nextIndicates that the link's context is a part of a series, and that the next in the series is the link target[RFC5988]Use in pagination to link to the next page of results
selfConveys an identifier for the link's context[RFC5988]Use to provide a canonical URL for a resource

Authorization Schema Registry

Schema NameDescriptionToken FormatHeader FormatRequired Claims/ParametersOptional Claims/ParametersUsage GuidelinesSecurity Considerations
Bearer TokenA simple token-based authentication schemeJWTAuthorization: Bearer <token>iss, sub, expaud, nbf, iatUse for most API authentication scenariosEnsure tokens are transmitted over HTTPS; Validate all claims