Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Admin, Formation, and Instance objects #18

Open
samamorgan opened this issue Jul 6, 2022 · 0 comments
Open

Add Admin, Formation, and Instance objects #18

samamorgan opened this issue Jul 6, 2022 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@samamorgan
Copy link
Collaborator

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}

@samamorgan samamorgan added the enhancement New feature or request label Aug 12, 2022
@samamorgan samamorgan added this to the v0.1.0 milestone Sep 16, 2022
@samamorgan samamorgan changed the title Add Instance and Admin objects Add Admin, Formation, and Instance objects Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant