@oystehr/sdk
Version:
Oystehr SDK
33 lines (30 loc) • 1.59 kB
text/typescript
// AUTOGENERATED -- DO NOT EDIT
import { OystehrClientRequest, TransactionalSMSSendParams, TransactionalSMSSendResponse } from '../..';
import { SDKResource } from '../../client/client';
import { OystehrConfig } from '../../config';
export class TransactionalSMS extends SDKResource {
constructor(config: OystehrConfig) {
super(config);
}
#baseUrlThunk(): string {
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
}
/**
* Send an SMS to any phone number. Oystehr's [Transactional SMS](https://docs.oystehr.com/oystehr/services/messaging/transactional-sms/) feature makes it easy to send a text message to your [Users](https://docs.oystehr.com/oystehr/services/app/users/) with a single API call. You can use this feature to send appointment reminders, prescription refill reminders, discharge information, and more.
*
* Access Policy Requirements:
* Action: `Messaging:SendTransactionalSMS`
* Access Policy Resource: `Messaging:TransactionalSMS`
* Action: `FHIR:Create`
* Access Policy Resource: `FHIR:Communication`
* Action: `FHIR:Update`
* Access Policy Resource: `FHIR:Communication`
*
* You also need Read access for the resource to which you are sending a message. For example:
* Action: `FHIR:Read`
* Access Policy Resource: `FHIR:Patient`
*/
send(params: TransactionalSMSSendParams, request?: OystehrClientRequest): Promise<TransactionalSMSSendResponse> {
return this.request('/messaging/transactional-sms/send', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
}