Integration API
This endpoint retrieves all integration data from a specified Twitter user. It fetches and processes tweets containing a specific welcome message and integrates the information into the system.
Route: /integration/all
/integration/all
Parameters:
No parameters are required for this endpoint.
Request Example:
Response:
The response contains an array of objects, each representing an integration. The structure of each object includes:
about
:Description: Description of the user who posted the referenced tweet.
Type: String
name
:Description: Name of the user who posted the referenced tweet.
Type: String
img
:Description: Profile image URL of the user who posted the referenced tweet.
Type: String
link
:Description: JSON string containing links to the user's website and Twitter profile.
Type: String
Format:
isoDate
:Description: ISO 8601 formatted date of the tweet.
Type: String
date
:Description: Unix timestamp of the tweet.
Type: Number
id
:Description: Twitter username of the user who posted the referenced tweet.
Type: String
spotlight
:Description: to know if an integration has been highlighted.
Type: String
Response Example:
Integration Spotlight
Set the spotlight on an integration
URL:
/integration/spotlight
Method:
POST
Authentication: Required (Bearer Token)
Request Body:
id
(String): Integration id.spotlight
(boolean, optional): true or false for spotlight. default is false.
Example Request:
Example Response (Success):
Example Response (Error):
Here is a GitBook-style documentation for the /integration/new
endpoint:
Create a New Integration
POST /integration/new
This endpoint creates a new integration record.
Headers
Authorization: Bearer token (required)
Request Parameters
about
String
A brief description of the integration (required).
name
String
The name of the integration (optional).
link
String
A URL link related to the integration (optional).
postUrl
String
The URL where the integration data will be posted (optional).
date
UnixTimeStamp
The timestamp representing the date of the integration (optional).
username
String
The username associated with the integration (required).
spotlight
String
Indicates if the integration is featured; can be 'true' or 'false' (optional).
file
ImageFile
An optional image file to be uploaded.
chain
Number(800 for solana)
The integrated project blockchain
address
String
The token contract address
File Upload
file
(optional): Accepts an image file to be associated with the integration.The file must be of a valid image type (e.g., JPEG, PNG) and should not exceed the maximum size limit defined by the server (
MAX_IMAGE_SIZE
).
Request Example
Response
Success: Returns a status of
true
and theid
of the created integration.Error: Returns an error object with relevant details.
File Too Large: If the uploaded image file exceeds the maximum size.
Internal Server Error: If there is an error in the database or server.
Missing Parameters: If required parameters are missing.
Behavior
Checks for the presence of required fields (
about
andusername
).Validates the optional image file type and size. If the file is valid and within the size limit, it is processed and stored.
Creates a new integration record in the database using the provided details.
Returns a success response with the integration ID if creation is successful; otherwise, returns an error response.
Authorization
This endpoint requires a valid authorization token to be passed in the headers.
Notes
Ensure that the
file
parameter is of a valid image type and does not exceed the server-definedMAX_IMAGE_SIZE
.The
username
serves as the unique identifier for the integration.
Retrieve Integration Data
GET /integration
Retrieves integration data based on the provided integrationId
query parameter.
Parameters:
integrationId
(string, required): The ID of the integration to retrieve.
Response:
Returns integration details including name, about, category, image, spotlight status, transaction ID, and other metadata.
Authentication:
Not required.
Retrieve Integration Market Data
GET /integration/:id/market
Fetches market data for a specific integration based on its ID.
Parameters:
id
(string, required): The ID of the integration.
Response:
Returns market information for the integration if available.
Authentication:
Not required.
Modify Integration Data
POST /integration/save
Modifies an existing integration by updating its details or uploading a file.
Parameters:
integrationId
(string, required): The ID of the integration.name
(string, optional): The name of the integration.about
(string, optional): A description of the integration.link
(JSON string, optional): A JSON object containing website and Twitter links.postUrl
(string, optional): URL of the post related to the integration.file
(file, optional): An image file associated with the integration.
Response:
Returns status of the modification process.
Authentication:
Required.
File Upload Limit:
Max file size is defined in system configuration.
Delete Integration Data
POST /integration/delete
Deletes an integration based on the provided integrationId
.
Parameters:
integrationId
(string, required): The ID of the integration to be deleted.
Response:
Returns success status if deletion is successful.
Authentication:
Required.
Set Integration Spotlight
POST /integration/spotlight
Updates the spotlight status of an integration.
Parameters:
id
(string, required): The ID of the integration.spotlight
(boolean, required): Whether to set the integration in the spotlight.
Response:
Returns success status if the update is successful.
Authentication:
Required.
Retrieve Integration Image
GET /integration/img/:id
Retrieves the image associated with an integration.
Parameters:
id
(string, required): The ID of the integration.
Response:
Returns the image file in its original format.
If no image is found, returns a 404 error.
Authentication:
Not required.
Last updated