Romani Gate, v1.2
Posted on

Web service for an interaction with the Instagram* Direct API.
Automatic read an user info when a thread history is requested.
* Запрещена в России / Banned in Russia.
Change Log
- When a thread history is requested additionally automatic read (one to choose):
- short user info;
- extended user info.
Features
- log in a bot account;
- working mode:
- run as a web service;
- control via the JSON-RPC like API;
- commands:
- send a text message to a specified user;
- send a link message to a specified user:
- automatic extract links from a message body;
- send a photo message to a specified user:
- automatic upload a specified photo to the Instagram* Direct:
- by an absolute path;
- by a path relative to a current working directory;
- automatic upload a specified photo to the Instagram* Direct:
- read a history of a thread with a specified user:
- automatic detect a thread ID;
- support a pagination of a history;
- filter a history by a specified user;
- restrict a history by a specified message ID;
- automatic extract a text from a link message;
- additionally automatic read (one to choose):
- short user info;
- extended user info.
* Запрещена в России / Banned in Russia.
API
API description in the Swagger format:
openapi: '3.0.0'
info:
title: romani-gate
version: 1.2.0
servers:
- url: http://localhost:{port}
variables:
port:
default: '8080'
paths:
/:
post:
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/command'
responses:
200:
description: OK
content:
application/json:
schema:
type: object
oneOf:
- $ref: '#/components/schemas/message'
- $ref: '#/components/schemas/history'
400:
$ref: '#/components/responses/error'
405:
$ref: '#/components/responses/error'
500:
$ref: '#/components/responses/error'
components:
schemas:
nullable_integer:
type: integer
nullable: true
nullable_number:
type: number
nullable: true
nullable_string:
type: string
nullable: true
numeric_string:
type: string
pattern: ^\\d+$
alphabetical_string:
type: string
pattern: ^[a-z_]+$
geo:
type: object
required:
- latitude
- longitude
properties:
latitude:
$ref: '#/components/schemas/nullable_number'
longitude:
$ref: '#/components/schemas/nullable_number'
address:
type: object
required:
- street
- city
- zip
- country_code
properties:
street:
$ref: '#/components/schemas/nullable_string'
city:
$ref: '#/components/schemas/nullable_string'
zip:
$ref: '#/components/schemas/nullable_string'
country_code:
$ref: '#/components/schemas/nullable_integer'
location:
type: object
required:
- geo
- address
properties:
geo:
$ref: '#/components/schemas/geo'
address:
$ref: '#/components/schemas/address'
command:
type: object
required:
- name
- parameters
properties:
name:
$ref: '#/components/schemas/alphabetical_string'
parameters:
type: object
message:
type: object
required:
- id
- timestamp
properties:
id:
$ref: '#/components/schemas/numeric_string'
type:
$ref: '#/components/schemas/alphabetical_string'
timestamp:
$ref: '#/components/schemas/numeric_string'
text:
$ref: '#/components/schemas/nullable_string'
user:
type: object
required:
- id
- category
- username
- full_name
- gender
- birthday
- biography
- location
- counters
- flags
properties:
id:
$ref: '#/components/schemas/numeric_string'
category:
$ref: '#/components/schemas/nullable_string'
username:
type: string
full_name:
type: string
gender:
$ref: '#/components/schemas/nullable_integer'
birthday:
$ref: '#/components/schemas/nullable_string'
biography:
$ref: '#/components/schemas/nullable_string'
location:
$ref: '#/components/schemas/location'
counters:
type: object
required:
- media
- followers
- followings
properties:
media:
$ref: '#/components/schemas/nullable_integer'
followers:
$ref: '#/components/schemas/nullable_integer'
followings:
$ref: '#/components/schemas/nullable_integer'
flags:
type: object
required:
- is_private
- is_business
- is_verified
properties:
is_private:
type: boolean
is_business:
type: boolean
nullable: true
is_verified:
type: boolean
history:
type: object
required:
- user
- messages
properties:
user:
$ref: '#/components/schemas/user'
messages:
type: array
items:
$ref: '#/components/schemas/message'
responses:
error:
description: Some Error
content:
text/plain:
schema:
type: string
Screenshots
POST /
