API Document
Update Text API
Update text of existing chart.
Http Method
PUT
Endpoint
Endpoint require chart_id and owner_secret parameters.
https://txt2chart.appspot.com/api/v1/chart/{chart_id}/txt?ost={owner_secret}
Sample endpoint.
https://txt2chart.appspot.com/api/v1/chart/eb173a01d98148e79c3565980e9b75a5/txt?ost=FMqxwaqVxwWClcQenRr1aiecFEaR1jEwfOXxINyfl6xkwhHBTz6JYoWYN0RcRPlW
Request body
Set CSV or TSV format new text to request body. Below is a sample text.
# test 10,20 20,30 30,40
Sample Code: curl
Before running curl, you must save new text to "txt_sample.txt" file.
curl -XPUT -H "content-type: text/plain" --data-urlencode @txt_sample.txt https://txt2chart.appspot.com/api/v1/chart/eb173a01d98148e79c3565980e9b75a5/txt?ost=FMqxwaqVxwWClcQenRr1aiecFEaR1jEwfOXxINyfl6xkwhHBTz6JYoWYN0RcRPlW
Sample Code: python
Following sample require requests library. If not installed, please run "pip install requests" before execute sample.
# -*- coding: utf-8 -*- import requests URL_TEMPLATE = "https://txt2chart.appspot.com/api/v1/chart/{chart_id}/txt?ost={owner_secret}" # parameters owner_secret = "FMqxwaqVxwWClcQenRr1aiecFEaR1jEwfOXxINyfl6xkwhHBTz6JYoWYN0RcRPlW" chart_id = "eb173a01d98148e79c3565980e9b75a5" url = URL_TEMPLATE.format(chart_id=chart_id,owner_secret=owner_secret) # new text txt = "#test\n10,20\n20,30\n30,40" # send put request r = requests.put(url,data=txt, headers={"content-type":"text/plain"}) # print output print r.text
Other APIs
comming soon!