Example of Contact User API
  • 15 Oct 2023
  • 1 Minute to read
  • Dark
    Light

Example of Contact User API

  • Dark
    Light

Article summary

The Api_ContactUser action exemplifies the application of this tool for crafting user-centric services. Here's a step-by-step guide for creating such an interface:

1. Accessing the Api_ContactUser Action

  • Begin by opening the OutSystems environment and locating the Api_ContactUser server action to understand its parameters and configurations.

2. Setting Up the Endpoint and Action

  • Action: Determine the specific action, such as CreateApiEndpointSubCreate, for creating a sub-endpoint.
  • EspaceEndpointId: Associate the API with a particular endpoint, for example, ApiDocumentCreate.EspaceEndpointId.
  • Path: Define a route for the API, like Api_Contact.Path.

3. Defining the Entity and Its Set

  • EntityName: Mention the entity this API will handle, in this case, "User".
  • EntitiesName: Designate a name for the collection of entities, like "Users".

4. Establishing the Endpoint Scope

  • EndpointScope: These settings dictate the operations your API will be capable of:
    • Listing sub-entities (ListSubEntities)
    • User operations (UpserSubEntity)
    • Delete operations (DeleteSubEntity)
    • Patch operations (PatchSubEntities)

5. Detailing Entity Attributes

  • SpecialFields: Specify fields that have particular significance, such as ContactId.
  • Unique: Identify the combination of fields that makes an entry unique, for instance, "ContactId, UserId".
  • Passive & Created fields: Specify fields that mark who created an entry ("CreatedBy") and when it was created ("CreatedOn").

6. Advanced Configuration

  • DeleteNotExists: Determine fields, like ContactId, which, if not existing, will result in the deletion of the related entry.
  • UniqueIgnore: Mention any fields that should be disregarded when checking for uniqueness.
  • PassiveNotExists: List fields that, when not present, should be marked as passive.

7. Embedding Custom Logic

  • CustomCode: Insert any custom logic required for your API operations, which will be executed when certain actions, such as listing or patching entities, are invoked.

8. Finalizing Your Configurations

It's crucial to remember to employ the ApiCommit action upon wrapping up the configurations for Api_ContactUser. This ensures that all settings are finalized, documentation is auto-generated, and any alterations are synchronized.

By meticulously following the above steps, OutSystems developers can seamlessly leverage the Agile.Now Endpoint accelerator to set up sophisticated REST interfaces that not only hasten development timelines but also remain in line with industry norms.


Was this article helpful?