×

Vi använder kakor för att göra LingQ bättre. Genom att besöka sajten, godkänner du vår cookie policy.

it   Italien

python example for creating a lesson for a course?

September 2017

I would like to upload some texts to my courses(collection) using the lingq API via python. I found some examples like updating lingq's using python (https://www.lingq.com/lingq_api/details/):

from httplib2 import Http

from urllib import urlencode

API_KEY = "xxxxxx"

h = Http()

data = dict(id=2782310, status=0, fragment="cinco horas")

url = 'http://www.lingq.com/api_v2/es/lingqs/?apikey=%s' % API_KEY

resp, content = h.request(url, "PUT", urlencode(data))

print resp

Is there a similar simple way for creating lessons for a course?

Like:

data=dict(collectionId=xxxxxxx, title:"Title1", text="text....")

url = 'http://www.lingq.com/api/v2/es/lesson/import/?apikey=%s' % API_KEY

resp, content = h.request(url, "PUT/POST???", urlencode(data))

Thanks.