Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/developedbyme/dbm-content-transactional-communication
https://github.com/developedbyme/dbm-content-transactional-communication
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/developedbyme/dbm-content-transactional-communication
- Owner: developedbyme
- License: mit
- Created: 2018-11-12T13:34:38.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-24T11:53:33.000Z (4 months ago)
- Last Synced: 2024-07-24T13:38:20.933Z (4 months ago)
- Language: PHP
- Size: 317 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
Transactional communcaiton for Dbm content
# API
## Data structures
### Enum: InitialSendType
- both : Send both email and text message if contact details exist for each method
- preferTextMessage : Send only text message if contact details exists, otherwise send email### Enum: SendTypeOption
- textMessage### User
```
{
id: int,
permalink: url,
name: string,
gravatarHash: string
}
```### UserWithPrivateData extends User
```
{
id: int (from User),
permalink: url (from User),
firstName: string,
lastName: string,
name: string (from User),
email: string,
gravatarHash: string (from User)
}
```## Endpoints
### Send password reset verification
Sends a password reset verification, 6 digit number, by email and/or text message.
#### Request
POST `/wp-json/wprr/v1/action/dbmtc/sendPasswordResetVerification`
```
{
sendType: InitialSendType (default: default),
user: id (int) or email (string)
}
```#### Response
```
{
code: "success",
data: {
verificationId: int,
sent: array of SendTypeOption
availableOptions: array of SendTypeOption
}
}
```#### Errors
```
{
code: "success",
data: {
message: "User not found"
}
}
```### Re-send password reset verification
Resends a previously sent verification
#### Request
POST `/wp-json/wprr/v1/action/dbmtc/resendPasswordResetVerification`
```
{
verificationId: int,
sendType: SendTypeOption
}
```#### Response
```
{
code: "success",
data: {
sent: array of SendTypeOption
}
}
```### Verify a password reset
Use the verification id and the code that the user has inputted in order to verify the reset
#### Request
POST `/wp-json/wprr/v1/action/dbmtc/verifyResetPassword`
```
{
user: id (int) or email (string),
verificationId: int,
verificationCode: int
}
```#### Response
```
{
code: "success",
data: {
verified: boolean
}
}
```### Set password with verification
Sets the user password after verification, and logs in the user
#### Request
POST `/wp-json/wprr/v1/action/dbmtc/setPasswordWithVerification`
```
{
user: id (int) or email (string),
verificationId: int,
password: string
}
```#### Response
```
{
code: "success",
data: {
authenticated: boolean
[userId: int],
[user: UserWithPrivateData],
[roles: array of string],
[restNonce: string],
[restNonceGeneratedAt: unix timestamp]
}
}
```