Add website - API
This guide is for websites that are not on the platform integrated by AIKTP and want to connect to AIKTP to use AI and publish posts.
To use this feature you need to program an endpoint on your website. AIKTP will communicate with your website through this endpoint.
Download sample source code
You can download the sample source code at https://aiktp.com/files/aiktp_api_php.zip
The process is: you modify the sample code and upload it back to your server. Ensure the methods on your server match the methods in the sample source code.
You can check the methods at the link postman
The methods
Note that the endpoint (URL) must be fixed and not change. Therefore the communication methods between AIKTP and you all use the POST.

When AIKTP communicates with you, it will do so via an API Key. You will manage this API key.
To edit the API key, open the aiktp_remote_api.php file in the zip file you downloaded.
Find the first line and modify apiKey as you wish

After editing, this API is the value you paste into the https://aiktp.com/websites

Operating mechanism
Verification
When you paste the API URL and API Key into the aiktp.com website and click Verify, the system will connect to you via the task "verifyAPIKey" and send it via the _POST method.
If you return success, the system will consider the verification successful and will be able to connect to you.
Publishing posts
After you verify the website, you can proceed to publish posts. The publishing process consists of 2 parts
Before publishing: The system will connect to you to get the categories via the task "getListCategories"

After you click the "Publish Now" button the system will connect to you via the task "createPost" or "updatePost" depending on whether that post has a currentPostId.
currentPostId is the value you return when performing the "createPost" task.
Note:
If you click the "Publish Now" button 2 or 3 times without reloading the page, the system will not have a currentPostId value and thus will create 2 or 3 identical posts. You must handle this case yourself.
If you publish to website A and then publish to website B, the system will include currentPostId and call the "updatePost" method; you also need to check the post before updating on your side
If you need assistance, please contact tele https://t.me/aiktpgroup
Last updated