AMI API

Artificial Machine Intelligence (AMI API)

ResourceReference
Repositoryhttps://github.com/WonkyMic/ami-api
Hosthttp://localhost:8080
Databasehttps://www.cockroachlabs.com/

Author

Store

Given Author information, when storing in DB, then return AMI Author ID.

Request

POST | /ami/author

NameTypeDescription
AliasStringPlatform Alias
PlatformStringPlatform name
PlatformAliasIduint64Platform specific author identifier

Response

Http StatusBody
201<Author Response>
302Author already exists
NameTypeDescription
IdUUIDAMI Author Identifier
AliasStringPlatform Alias
PlatformStringPlatform name
PlatformAliasIduint64Platform 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 StatusBody
200Author Deleted

Validation Rules

  • Deletes Reactions for Author
  • Deletes Messages by Author as well as the related message reactions

Given Platform Alias ID, then return associated author information.

Request

GET | /ami/author/search

Query Parameters

NameTypeDescription
platformAliasIdStringPlatform specific author identifier

Response

Http StatusBody
200<Author>
NameTypeDescription
IdUUIDAMI Author Identifier
AliasStringPlatform Alias
PlatformStringPlatform name
PlatformAliasIduint64Platform specific author identifier

Retrieve

Given AMI Author ID, then return associated author information.

Request

GET | /ami/author/<id>

NameTypeDescription
IdUUIDAMI Author Identifier

Response

Http StatusBody
200<Author>
NameTypeDescription
IdUUIDAMI Author Identifier
AliasStringPlatform Alias
PlatformStringPlatform name
PlatformAliasIduint64Platform 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 StatusBody
200List<Author>
NameTypeDescription
IdUUIDAMI Author Identifier
AliasStringPlatform Alias
PlatformStringPlatform name
PlatformAliasIduint64Platform specific author identifier

Retrieve Reactions

Given an Author ID, then retrieve the list of associated reactions.

Request

GET | /ami/author/<id>/reactions

Response

Http StatusBody
200List<Reaction>
NameTypeDescription
MessageIdStringMessage Identifier
AuthorIdStringAuthor Identifier
Reactionuint64Reaction 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

NameTypeDescription
AuthorIdStringIdentifier used by Platform
ContentStringMessage Content
PlatformStringPlatform name

Response

Http StatusBody
201<Message>
400Bad Request
NameTypeDescription
IdUUIDAMI Message Identifier
AuthorIdUUIDIdentifier used by Platform
ContentStringMessage Content
PlatformStringPlatform name

Validation Rules

  • Author must exist.

Delete

Given message ID, when invoking the delete AMI API, then delete the related message.

Request

DELETE | /ami/message/<id>

Response

Http StatusBody
200Message Deleted

Retrieve

Given the AMI API, when invoked with a Message ID, then return the associated message content

Request

GET | /ami/message/<id>

NameTypeDescription
IdUUIDAMI Message Identifier

Response

Http StatusBody
200<Message>
NameTypeDescription
IdUUIDAMI Message Identifier
AuthorIdUUIDIdentifier used by Platform
ContentStringMessage Content
PlatformStringPlatform name

Retrieve List

Given the AMI API, when the Get endpoint is invoked, then return a message list.

Request

GET | /ami/message/

Response

Http StatusBody
200List<Message>
NameTypeDescription
IdUUIDAMI Message Identifier
AuthorIdUUIDIdentifier used by Platform
ContentStringMessage Content
PlatformStringPlatform name

Retrieve Reactions

Given a message ID, then retrieve the list of associated reactions.

Request

GET | /ami/message/<id>/reactions

NameTypeDescription
IdUUIDAMI Message Identifier

Response

Http StatusBody
200List<Reaction>
NameTypeDescription
MessageIdStringMessage Identifier
AuthorIdStringAuthor Identifier
Reactionuint64Reaction 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

NameTypeDescription
MessageIdStringMessage Identifier
AuthorIdStringAuthor Identifier
Reactionuint64Reaction Integer

Response

NameTypeDescription
MessageIdStringMessage Identifier
AuthorIdStringAuthor Identifier
Reactionuint64Reaction Integer

Validation Rules

  • Author must exist.
  • Message must exist.
  • Reaction relationship must not already exist.