Earning $500/Month By Automating Medium Using WriteSonic. Part-1

By akohad Apr14,2023

[ad_1]

Part 1:

  1. Advance usage of ChatSonic API. (Learning About Memory Functionality)

Part 2:

  1. Introduction to WriteSonic API and basic features

Part 3:

Covering all the features may not be possible but the series will cover the most useful tools for automation.

Part 4:

Integrating Medium API with WriteSonic API using Python.

  1. Authenticating User.
  2. Generating API Token
  3. Fetching data about the user
  4. Creating a post
  5. Creating a post under publication

Part 5: Integrating Rephrase In The Automation. (This will only be integrated as per the comments on the article)

WritesSonic Image
Source: https://www.g2.com/products/writesonic/

Click here to try “WriteSonic” for free.

ChatSonic Webpage
Source: https://www.bloggersgoto.com/

Features of this API [From WriteSonic Doc]

  • enable/disable memory functionality
  • talk to ChatSonic in 24 languages

Integrating ChatSonic API Using Python

pip install requests

Step 2: Asking Question From ChatSonic

import requests

API_KEY = "Your API KEY"

url = "https://api.writesonic.com/v2/business/content/chatsonic?engine=premium"

payload = {
"enable_google_results": True, #If enabled, ChatSonic will use Google search results to answer the question.
"enable_memory": False, #if enabled, ChatSonic will remember the previous conversation.
"history_data": [
{
"is_sent": bool,
"message":"Value"
}
], #Used when memory functionality is set to
"input_text": [Question You Want To Ask] #should be string
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"X-API-KEY": API_KEY
}

response = requests.post(url, json=payload, headers=headers)

print(response. Text)

Step 3: Asking Question From ChatSonic By Enabling The Memory Functionality.

import requests

API_KEY = "Your API KEY"

url = "https://api.writesonic.com/v2/business/content/chatsonic?engine=premium"

payload = {
"enable_google_results": True, #If enabled, ChatSonic will use Google search results to answer the question.
"enable_memory": True, #if enabled, ChatSonic will remember the previous conversation.
"history_data": [
{
"is_sent": True, #the value of is_sent will be True for the User_Prompt and False for the ChatSonic.
"message":"Question asked by user."
},
{
"is_sent": False, #the value of is_sent will be False for the ChatSonic response.
"message":"Response from the ChatSonic."
}
], #Used when memory functionality is set to
"input_text": [Question You Want To Ask] #should be string
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"X-API-KEY": API_KEY
}

response = requests.post(url, json=payload, headers=headers)

print(response. Text)

Stay tuned for the rest of the series.

And feel free to use WriteSonic to follow along with the series.

Follow us on Instagram



[ad_2]

Source link

By akohad

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *