Skip to content

Add Admin, Formation, and Instance objects #18

@samamorgan

Description

@samamorgan

Some models have both instance-specific and account-wide endpoints. This concept should be codified. For instance, User models currently hit the admin endpoint for most cases (with the exception of Users().get(region="{region}")). I think something like the following might be better.

instance = welkin.Instance(instanceName="{name}")
users = instance.Users().get()

admin = welkin.Admin()
users = admin.Users().get()

Notes

There are instance endpoints, but they're restricted to UI only (HTTP 403 with error code ACCESS_FOR_API_CLIENT_RESTRICTED). So we unfortunately can't list the available instances to use or verify that an instance exists. The ones I've found so far are:

GET https://api.live.welkincloud.io/{{tenantName}}/admin/instances?includeArchived=true

[
    {
        "id": "{{UUID}}",
        "createdAt": "2022-04-27T15:47:59.312Z",
        "updatedAt": "2022-06-21T19:28:52.803Z",
        "instanceType": "SANDBOX",
        "instanceName": "{{NAME}}",
        "instanceDescription": "{{DESCRIPTION}}",
        "schemaSize": "{{INTEGER}} kB",
        "patientCount": 0,
        "archived": false,
        "archiveDate": null,
        "domain": null,
        "webhookApiKey": "{{KEY}}",
        "webhookApiSecret": "{{SECRET_KEY}}",
        "chatWebhookUrl": "{{URL}}",
        "chatServiceSid": null,
        "docusignUserId": null,
        "docusignAccountId": null,
        "docusignIntegrationKey": null,
        "docusignRsaPrivateKey": null,
        "docusignBaseUrl": null,
        "docusignAuthTokens": [],
        "phones": [],
        "tenantId": "UUID",
        "instanceState": "ACTIVE",
        "schemaName": "instance-UUID"
    },
    ...
]

PATCH https://api.live.welkincloud.io/{{tenantName}}/admin/instances/{instanceId}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions