AMI API
Artificial Machine Intelligence (AMI API)
Author #
Store #
Given Author information, when storing in DB, then return AMI Author ID.
Request
POST | /ami/author
| Name | Type | Description |
|---|
Alias | String | Platform Alias |
Platform | String | Platform name |
PlatformAliasId | uint64 | Platform specific author identifier |
Response #
| Http Status | Body |
|---|
| 201 | <Author Response> |
| 302 | Author already exists |
| Name | Type | Description |
|---|
Id | UUID | AMI Author Identifier |
Alias | String | Platform Alias |
Platform | String | Platform name |
PlatformAliasId | uint64 | Platform specific author identifier |
Validation Rules #
- Author must not already exist by PlatformAliasId.
Delete #
Given AMI Author ID, when delete API is invoked, then delete the Author.
Request
DELETE | /ami/author/<id>
Response #
| Http Status | Body |
|---|
200 | Author Deleted |
Validation Rules #
- Deletes Reactions for Author
- Deletes Messages by Author as well as the related message reactions
Search #
Given Platform Alias ID, then return associated author information.
Request
GET | /ami/author/search
Query Parameters #
| Name | Type | Description |
|---|
platformAliasId | String | Platform specific author identifier |
Response #
| Http Status | Body |
|---|
200 | <Author> |
| Name | Type | Description |
|---|
Id | UUID | AMI Author Identifier |
Alias | String | Platform Alias |
Platform | String | Platform name |
PlatformAliasId | uint64 | Platform specific author identifier |
Retrieve #
Given AMI Author ID, then return associated author information.
Request
GET | /ami/author/<id>
| Name | Type | Description |
|---|
Id | UUID | AMI Author Identifier |
Response #
| Http Status | Body |
|---|
200 | <Author> |
| Name | Type | Description |
|---|
Id | UUID | AMI Author Identifier |
Alias | String | Platform Alias |
Platform | String | Platform name |
PlatformAliasId | uint64 | Platform specific author identifier |
Retrieve List #
Given the AMI API, when the Get Author endpoint is invoked, then return Author list.
Request
GET | /ami/author/
Response #
| Http Status | Body |
|---|
200 | List<Author> |
| Name | Type | Description |
|---|
Id | UUID | AMI Author Identifier |
Alias | String | Platform Alias |
Platform | String | Platform name |
PlatformAliasId | uint64 | Platform specific author identifier |
Retrieve Reactions #
Given an Author ID, then retrieve the list of associated reactions.
Request
GET | /ami/author/<id>/reactions
Response #
| Http Status | Body |
|---|
200 | List<Reaction> |
| Name | Type | Description |
|---|
MessageId | String | Message Identifier |
AuthorId | String | Author Identifier |
Reaction | uint64 | Reaction Integer |
Message #
Store #
Given the AMI API, when invoked with a Message Body, then store the content and return a Message ID.
Request
POST | /ami/message
| Name | Type | Description |
|---|
AuthorId | String | Identifier used by Platform |
Content | String | Message Content |
Platform | String | Platform name |
Response #
| Http Status | Body |
|---|
201 | <Message> |
400 | Bad Request |
| Name | Type | Description |
|---|
Id | UUID | AMI Message Identifier |
AuthorId | UUID | Identifier used by Platform |
Content | String | Message Content |
Platform | String | Platform name |
Validation Rules #
Delete #
Given message ID, when invoking the delete AMI API, then delete the related message.
Request
DELETE | /ami/message/<id>
Response #
| Http Status | Body |
|---|
200 | Message Deleted |
Retrieve #
Given the AMI API, when invoked with a Message ID, then return the associated message content
Request
GET | /ami/message/<id>
| Name | Type | Description |
|---|
Id | UUID | AMI Message Identifier |
Response #
| Http Status | Body |
|---|
200 | <Message> |
| Name | Type | Description |
|---|
Id | UUID | AMI Message Identifier |
AuthorId | UUID | Identifier used by Platform |
Content | String | Message Content |
Platform | String | Platform name |
Retrieve List #
Given the AMI API, when the Get endpoint is invoked, then return a message list.
Request
GET | /ami/message/
Response #
| Http Status | Body |
|---|
200 | List<Message> |
| Name | Type | Description |
|---|
Id | UUID | AMI Message Identifier |
AuthorId | UUID | Identifier used by Platform |
Content | String | Message Content |
Platform | String | Platform name |
Retrieve Reactions #
Given a message ID, then retrieve the list of associated reactions.
Request
GET | /ami/message/<id>/reactions
| Name | Type | Description |
|---|
Id | UUID | AMI Message Identifier |
Response #
| Http Status | Body |
|---|
200 | List<Reaction> |
| Name | Type | Description |
|---|
MessageId | String | Message Identifier |
AuthorId | String | Author Identifier |
Reaction | uint64 | Reaction Integer |
Reaction #
Store #
Given Author and Message IDs, when invoked with a Message Reaction, then store the reaction by Message ID.
Request
POST | /ami/reaction
| Name | Type | Description |
|---|
MessageId | String | Message Identifier |
AuthorId | String | Author Identifier |
Reaction | uint64 | Reaction Integer |
Response #
| Name | Type | Description |
|---|
MessageId | String | Message Identifier |
AuthorId | String | Author Identifier |
Reaction | uint64 | Reaction Integer |
Validation Rules #
- Author must exist.
- Message must exist.
- Reaction relationship must not already exist.