Skip to main content

So I am building a mule project that will combine some apis. My question is regarding the SAPIs.

 

There currently is two apis and each has their own RAML.

 

The first is notification and the second if notification-content.

 

Notification sends notification but is not directly via the api, it actually calls another API to do this, requirement due to some limitations with our network.

 

Notification-Content holds the subject and body, parameterized, of notifications that can then be populated in a PAPI and sent to the notification sapi to be sent off into the ether.

 

XAPI -> PAPI -> Notification Cotent SAPI -> PAPI (populates email) -> Notification SAPI -> external API

 

My first question: Should the notification and notification content SAPIs be combined?

 

Additionally in the notification-content sapi there is are the system and notification tables:

 

Original

/notificationContent/{systemName}

/notificationContent/{systemName}/{notificationType}

 

"Pluralized"

 

/notifications/contents/systems/{systemName}:  

/notifications/contents/notifications/{systemName}/{notificationType}:

 

Hyphenated

 

/notifications-content/systems/{systemName}:  

/notifications-content/notifications/{systemName}/{notificationType}:

 

Any advice on the endpoint naming?

1 réponse
  1. Forum Ambassador Anurag Sharma (Nagarro)
    10 juil. 2023, 19:11

    Hello @Michael Fesser​ 

     

    Whether to combine the notification and notification content SAPIs or keep them separate depends on the functional and logical separation between the two. If they have distinct purposes and can be considered as separate resources, it might be better to keep them separate. However, if they are closely related and share common functionalities, combining them could make sense. Evaluate the complexity, maintainability, and reusability factors to make an informed decision.

     

    here as you are using them to just creating the structures and then send to external api, so i think it should be as below

     

    XAPI -> PAPI -> Notification SAPI -> external API

     

    Choosing the right endpoint naming convention is important for the clarity and consistency of your API. There isn't a definitive answer as to which convention is best, as it depends on your specific use case and preferences

     

    Here are the our recommended naming conventions to follow for REST API endpoints:

    • REST API endpoints should follow good naming practices for better usability, maintainability, and scalability.
    • Use nouns, preferably plural, to represent resources, aligning with the REST architectural style.
    • Avoid deep nesting and unnecessary special characters in endpoint names.
    • Separate words with hyphens and use lowercase letters to prevent confusion.
    • Don’t use file extensions in URIs. Use the Content-Type entity-header to denote the original file type.
    • Consistent naming conventions in REST API endpoints enhance readability, understanding, and troubleshooting, and foster growth and scalability.