Zenler Public API Documentation

Introduction

With Zenler API you can now integrate your Zenler Account with your external apps, websites, SSO or services.

API Version

API Version - v1.0 Published on Dec 14th 2018

Authentication

For Authentication purposes, your API KEY and the subdomain name of your site needs to be set in the header of all API calls. The header keys that need to be set are given below:

  • X-API-Key
  • X-Account-Name
  • Content-Type - application/json
  • Accept - application/json

For Example:

curl https://api.newzenler.com/api/v1/users -H 'X-API-Key: my-api-key' -H 'X-Account-Name: my-school' -H 'Content-Type: application/json' -H 'Accept: application/json'

Data Format

Will be in JSON format.

Date Format

YYYY-MM-DD will be the format of dates.

Authentication Errors

Errors a user can expect on invalid authentication.

  • Api key missing
  • Account name missing
  • Invalid Api key or account name

Pagination

You will receive upto a max 15 items on your responses by default. However, you can increase the limit using the "limit" param in your request.

Rate limit

API calls are restricted to a max of 1000 /min. If you hit the limits, you will receive a 403 error code and an error message "Rate Limited Exceeded" in your response body.

Reference

Users

GET Get Users list
https://api.newzenler.com/api/v1/users?limit=&page=&orderby=&order=&search=&role[]=3&role[]=4

role_ids

2 => Site Admin
3 => Course Instructor
4 => Student
7 => Affiliate
8 => Lead
11 => Assistant
12 => Support
PARAMS

limit

The number of items to be returned. Default: 15 , Type: Number

page

The page within the collection to fetch.Default: 1

orderby

any users table field like name, last_name, email. Default: created_at

order

'asc' or 'desc' . Default: 'desc'

search

get list with search keyword. Searches for first name , last name or email

role[]
3
role[]
4
Example Response
{"response_code":200,"message":"success","data": { "items":[ { "id":"313.5c0f4d18eff59", "first_name":"Test", "last_name":"Test", "email":"test@example.com", "bio":null, "address":"", "city":"", "state":"", "zip_code":"", "roles":[ 8 ] } ], "pagination":{ "total_items":129, "items_per_page":1, "page_index":1, "total_pages":129 } }}}


POST Add User
https://api.newzenler.com/api/v1/users

Response – Returns user's id, first name, last name and email on success.

ATTRIBUTES

first_name
Test
last_name
Test
email
test@example.com
password
123456
commission
10
roles
[3, 7]
OPTIONAL ATTRIBUTES

address
address1
city
city1
state
state1
phone
11111111
zip_code
2222
country
country1
gdpr_consent_status
0 or 1

Applicable only for user from European Country

1=>Accept GDPR consent text

0=>Deny GDPR consent text

Example Response
{"response_code":201,"message":"People added successfully","data":{"id":"313.5c109f1b58473","first_name":"test","last_name":"test","email":"test123456@example.com"}}"


PUT Update User
https://api.newzenler.com/api/v1/users/{user_id}
ATTRIBUTES

first_name
test
last_name
test
email
test@example1.com
password
123456
commission
20
roles
[3, 7]
OPTIONAL ATTRIBUTES

address
address1
city
city1
state
state1
phone
11111111
zip_code
2222
country
country1
gdpr_consent_status
0 or 1

Applicable only for user from European Country

1=>Accept GDPR consent text

0=>Deny GDPR consent text

Example Response
{"response_code":200,"message":"success","data":{"message":"People updated successfully"}}"


GET Get User Details
https://api.newzenler.com/api/v1/users/{user_id}

Response – User Details on success

Example Response
{"response_code":200,"message":"success","data":{"id":"313.5bc576509d13d","first_name":"test","last_name":"test","email":"test@example.com","bio":null,"address":"","city":"","state":"","zip_code":"","roles":[4],"phone":"1234567"}}


DEL Delete a User
https://api.newzenler.com/api/v1/users/{user_id}
Example Response
{"response_code":200,"message":"success","data":"User deleted successfully"}


POST Enroll User to a Course
https://api.newzenler.com/api/v1/users/{user_id}/enroll
ATTRIBUTES

course_id
Number

Course ID

OPTIONAL ATTRIBUTES

plan_id
Number

Course Plan ID

Example Response
{"response_code":200,"message":"success","data":"User enrolled to the course successfully with plan Plan1"}"


POST Unenroll User from a Course
https://api.newzenler.com/api/v1/users/{user_id}/unenroll
ATTRIBUTES

course_id
Number

Course ID

Example Response
{"response_code":400,"message":"failed","data":{"message":"User is not enrolled in this course."}}


Courses

GET Get List of Courses
https://api.newzenler.com/api/v1/courses?limit=&page=&orderby=&order=&search=&type=&status=
PARAMS

limit

The number of items to be returned. Default: 15 , Type: Number

page

The page within the collection to fetch.Default: 1

orderby

Any courses table field. Default: display_order

order

'asc' or 'desc' . Default: 'asc'

search

search for course name

type

1 - course, 2 = bundle. Default 0 (All list)

status

1 - Published. 0 - unpublised Default: All

Example Response
{"response_code":200,"message":"success","data":{"items":[{"id":1159,"name":"test","subtitle":"test","thumbnail":"https:\/\/api.newzenler.com\/images\/default-course-thumbnail.png","url":"https:\/\/api.newzenler.com\/courses\/test"}],"pagination":{"total_items":98,"items_per_page":1,"page_index":1,"total_pages":98}}}


GET Get a Specific Course
https://api.newzenler.com/api/v1/courses/{course_id}

Response – Course details on success

Example Response
{"response_code":200,"message":"success","data":{ "items":{ "id":1150, "name":"test", "subtitle":"test", "thumbnail":"https:\/\/s3.amazonaws.com\/contents.newzenler.com\/313\/courses\/1150\/data\/thumb\/l-4.jpg", "course_type":2, "owner":"313.5aacb2806f857", "school_id":313, "public":1, "featured":1, "hidden":1, "private":1 } } }


POST Enroll User(s) to a Course
https://api.newzenler.com/api/v1/courses/{course_id}/enroll
ATTRIBUTES

users
313.erferfdf1234
users
313.erferfdf1235
OPTIONAL ATTRIBUTES

plan_id
Number

Course Plan ID

Example Response
{"response_code":200,"message":"success","data":"User enrolled to the course successfully"}"


Funnels

GET Get List of Funnels
https://api.newzenler.com/api/v1/funnels?limit=&page=&orderby=&order=&search=&status=
PARAMS

limit

The number of items to be returned. Default: 15 , Type: Number

page

The page within the collection to fetch.Default: 1

orderby

Any marketting_funnels table field. Default: created_at

order

'asc' or 'desc' . Default: 'asc'

search

search for funnel name

status

1 - Published. 0 - unpublised Default: All

Example Response
{"response_code":200,"message":"success","data":{"items":[{"id":96,"name":"test","type":"Lead Funnel","url":"https:\/\/api.newzenler.com\/f\/test","total_leads":1,"thumbnail":"https:\/\/s3.amazonaws.com\/contents.newzenler.com\/313\/pages\/3622\/thumb.jpg?rl=XZezuyG9XeXRRtU"}],"pagination":{"total_items":74,"items_per_page":1,"page_index":1,"total_pages":74}}}


GET Get List of Enrollments for a Funnel
https://api.newzenler.com/api/v1/funnels/enrollments/{funnel_id}

Response – Users List enrolled in the specified funnel

Example Response
{"response_code":200,"message":"success","data":{"items":[{"id":"313.5bc1bfe4d771c","first_name":"test1","last_name":null,"email":"test1@example.com","enrolled_on":"2018-10-13 09:50:28"},{"id":"313.5bc19b4c28356","first_name":"test2","last_name":null,"email":"test2@example.com","enrolled_on":"2018-10-13 07:14:20"},{"id":"313.5bb34680d3fda","first_name":"test3","last_name":null,"email":"test3@example.com","enrolled_on":"2018-10-02 10:20:49"}]}}


Example Request
Get List of Enrollments for a Funnel
curl --location --request GET "https://api.newzenler.com/api/v1/funnels/enrollments/%7Bfunnel_id%7D"
POST Subscribe To Funnel
https://api.newzenler.com/api/v1/funnels/{funnel_id}/subscribe
ATTRIBUTES

name
test
email
test@gmail.com
OPTIONAL ATTRIBUTES

last_name
Test
address
address1
city
city1
state
state1
phone
11111111
zip_code
2222
country
country1
gdpr_consent_status
0 or 1

Applicable only for user from European Country

1=>Accept GDPR consent text

0=>Deny GDPR consent text

Example Response
{"response_code":200,"message":"success","data":{"name":"test","email":"test@gmail.com","funnel":"funnel1"}}"
POST Unsubscribe From Funnel
https://api.newzenler.com/api/v1/funnels/{funnel_id}/unsubscribe
ATTRIBUTES

email
test@gmail.com
Example Response
{"response_code":200,"message":"success","data":"User unsubscribed successfully"}

Live classes and Live webinars

GET Get list of upcoming live classes
https://api.newzenler.com/api/v1/live-class/get-live-classes-list?limit=&page=&orderby=&order=&search=&
PARAMS

limit

The number of items to be returned. Default: 15 , Type: Number

page

The page within the collection to fetch.Default: 1

orderby

Any live_class table field. Default: created_at

order

'asc' or 'desc' . Default: 'asc'

search

search for live class topic

Example Response
{"response_code":200,"message":"success","data":{"items":[{"id":4,"topic":"Test Liveclass","schedule_date":"2021-10-08 12:00 PM","timezone":"Asia\/Kolkata","duration":30,"register_url":"https:\/\/beta.newzenler.com\/live-class\/test-liveclass\/register","recurring":false,"recent_recurring_schedule":""}],"pagination":{"total_items":3,"items_per_page":1,"page_index":1,"total_pages":3}}}


POST Register Live Class
https://api.newzenler.com/api/v1/live-class/{liveclass_id}/register
ATTRIBUTES

name
Test
email
test@example.com
OPTIONAL ATTRIBUTES

last_name
Test
Example Response
{"response_code":200,"message":"success","data":{"name":"Test","email":"test@example.com","live class":"Test Liveclass","message":"User Registered Successfully!"}}


POST Unregister Live Class
https://api.newzenler.com/api/v1/live-class/{liveclass_id}/unregister
ATTRIBUTES

email
test@example.com
Example Response
{"response_code":200,"message":"success","data":"User unregistered successfully"}


GET Get list of upcoming live webinars
https://api.newzenler.com/api/v1/live-webinar/get-live-webinars-list?limit=&page=&orderby=&order=&search=&type=&status=
PARAMS

limit

The number of items to be returned. Default: 15 , Type: Number

page

The page within the collection to fetch.Default: 1

orderby

Any live_webinar table field. Default: created_at

order

'asc' or 'desc' . Default: 'asc'

search

search for live webinars topic

Example Response
{"response_code":200,"message":"success","data":{"items":[{"id":1,"topic":"Test Webinar","schedule_date":"2021-10-09 12:00 PM","timezone":"Asia\/Kolkata","duration":30,"register_url":"https:\/\/beta.newzenler.com\/live-webinar\/test-webinar\/register","recurring":false,"recent_recurring_schedule":""}],"pagination":{"total_items":2,"items_per_page":1,"page_index":1,"total_pages":2}}}


POST Register Live Webinar
https://api.newzenler.com/api/v1/live-webinar/{webinar_id}/register
ATTRIBUTES

name
Test
email
test@example.com
OPTIONAL ATTRIBUTES

last_name
Test
address
Test
city
Test
state
Test
phone
11111111
zip_code
2222
Example Response
{"response_code":200,"message":"success","data":{"name":"Test","email":"test@example.com","live webinar":"Test Webinar","message":"User Registered Successfully!"}}


POST Unregister Live Webinar
https://api.newzenler.com/api/v1/live-webinar/{webinar_id}/unregister
ATTRIBUTES

email
test@example.com
Example Response
{"response_code":200,"message":"success","data":"User unregistered successfully"}


Reports

GET Get Brief List of Enrollments Report
https://api.newzenler.com/api/v1/reports/enrollments/brief?start_date&end_date&course_ids[]=
PARAMS

start_date

String - Should be in format YYYY-mm-dd (2018-05-18)

end_date

String - Should be in format YYYY-mm-dd (2018-05-18)

course_ids[]

Specify course id

Example Response
{"response_code":200,"message":"success","data":{"items":[{"course_id":1156,"course_name":"test","no_of_enrollments":7}],"pagination":{"total_items":3,"items_per_page":1,"page_index":1,"total_pages":3}}}


GET Get Detailed List of Enrollments Report
https://api.newzenler.com/api/v1/reports/enrollments/detailed?start_date&end_date&course_id=
PARAMS

start_date
end_date
course_id
Example Response
{"response_code":200,"message":"success","data":{"items":[{"course_id":1156,"user_id":"313.5c0235e95c1dc","course_name":"test","first_name":"Api8","last_name":"api8","email":"api8@example.com","enrollment_date":"2018-12-01 07:24:32"},{"course_id":1156,"user_id":"313.5c0107512b7a8","course_name":"test","first_name":"test","last_name":"2","email":"test2@test.com","enrollment_date":"2018-12-01 04:48:13"},{"course_id":1156,"user_id":"313.5bf3874bb633f","course_name":"test","first_name":"Api3","last_name":"api3","email":"api3@example.com","enrollment_date":"2018-11-22 11:11:11"},{"course_id":1156,"user_id":"313.5bf387f0d29eb","course_name":"test","first_name":"Api4","last_name":"api4","email":"api4@example.com","enrollment_date":"2018-11-22 11:11:11"},{"course_id":1156,"user_id":"313.5bf39ac8a732e","course_name":"test","first_name":"Api61","last_name":"api61","email":"api61@example.com","enrollment_date":"2018-11-22 10:41:49"},{"course_id":1156,"user_id":"313.5bc5a81b4f8be","course_name":"test","first_name":"test","last_name":"test","email":"test@sdds.com","enrollment_date":"2018-11-22 10:40:52"},{"course_id":1156,"user_id":"313.5aacb3079ca59","course_name":"test","first_name":"test","last_name":"Test","email":"test@gmail.com","enrollment_date":"2018-10-22 10:21:40"}]}}


GET Get Sales Brief Report
https://api.newzenler.com/api/v1/reports/sales/brief?start_date=&end_date=&limit=&page=&groupby=&course_ids[]=
PARAMS

start_date

String - Should be in format YYYY-mm-dd (2018-05-18)

end_date

String - Should be in format YYYY-mm-dd (2018-05-18)

limit

The number of items to be returned. Default: 15 , Type: Number

page

The page within the collection to fetch.Default: 1, Type: Number

groupby

It can be course, day or month. Default: course

course_ids[]

Specify course id

Example Response
{"response_code":200,"message":"success","data":{"items":[{"total_sales":1,"course_id":1156,"earnings_total":"18.52","sales_total":"20.00","aff_fee":"0.00","name":"pppp","day":"12\/01\/2018","month":"December-2018","currency":"USD"}],"pagination":{"total_items":19,"items_per_page":1,"page_index":1,"total_pages":19}}}


GET Get Sales Detailed Report
https://api.newzenler.com/api/v1/reports/sales/detailed?start_date=&end_date=&limit=&page=&course_ids[]=&af_v&coupon_is[]&coupon_like[]&name_is[]&name_like[]&email_is[]&email_like[]&affiliate_is[]&payment_type
PARAMS

start_date

String - Should be in format YYYY-mm-dd (2018-05-18)

end_date

String - Should be in format YYYY-mm-dd (2018-05-18)

limit

The number of items to be returned. Default: 15 , Type: Number

page

The page within the collection to fetch.Default: 1, Type: Number

course_ids[]

Specify course id

af_v

Advanced Filter - Specify 1 for advanced filter

coupon_is[]

String - Coupon ID

coupon_like[]
name_is[]

String - User ID

name_like[]
email_is[]

String - User ID

email_like[]
affiliate_is[]

String - Affiliate ID

payment_type

Number 2 (Subscription) or 3 (One time payment) or 4 (Payment plan)

Example Request
https://api.newzenler.com/api/v1/reports/sales/detailed?start_date=&end_date=&limit=&page=&course_ids[]=&af_v=1&coupon_is[0][]=coupon_id&coupon_like[]&name_is[0][]=user_id&name_like[]&email_is[0][]=user_id&email_like[]&affiliate_is[]&payment_type
Example Response
{"response_code":200,"message":"success","data":{"items":[{"created_at":"12\/01\/2018","transaction_id":"ch_1DcQOlAtpWV408k9dAlNnzN3","sales_price":"$20.00","earn_price":"$18.52","student_name":"test 2","student_email":"test2@test.com","course":"pppp","course_id":1156,"coupon_code":null,"payment_gateway":"Stripe"}],"pagination":{"total_items":1,"items_per_page":1,"page_index":1,"total_pages":1}}}


GET Get Course Progress Brief Report
https://api.newzenler.com/api/v1/reports/course-progress/brief?start_date=&end_date=&limit=&page=&course_ids[]=
PARAMS

start_date

String - Should be in format YYYY-mm-dd (2018-05-18)

end_date

String - Should be in format YYYY-mm-dd (2018-05-18)

limit

The number of items to be returned. Default: 15 , Type: Number

page

The page within the collection to fetch.Default: 1, Type: Number

course_ids[]

Specify course id

Example Response
{"response_code":200,"message":"success","data":{"items":{"1036":{"courseId":1036,"start_date":"","last_date":" 23:59:59","courseName":"111","total_students":2,"not_started":1,"in_progress":1,"completed":0,"pass_rate":75},"1026":{"courseId":1026,"start_date":"","last_date":" 23:59:59","courseName":"1111","total_students":2,"not_started":2,"in_progress":0,"completed":0,"pass_rate":75}},"pagination":{"total_items":47,"items_per_page":"2","page_index":"1","total_pages":24}}}


GET Get Course Progress Detailed Report
https://{{account-name}}.newzenler.com/api/v1/reports/course-progress/detailed?start_date=&end_date=&limit=&page=&course_id[]=&af_v=&coupon_is[]=&coupon_like[]=&name_is[]=&name_like[]=&email_is[]=&email_like[]=&affiliate_is[]=&payment_type=&students_in_course[0][]=
PARAMS

start_date

String - Should be in format YYYY-mm-dd (2018-05-18)

end_date

String - Should be in format YYYY-mm-dd (2018-05-18)

limit

The number of items to be returned. Default: 15 , Type: Number

page

The page within the collection to fetch.Default: 1, Type: Number

course_id[]

Specify course id

af_v

Advanced Filter - Specify 1 for advanced filter

coupon_is[]
coupon_like[]
name_is[]
name_like[]
email_is[]
email_like[]
affiliate_is[]

String - Affiliate ID

payment_type

Number 2 (Subscription) or 3 (One time payment) or 4 (Payment plan)

students_in_course[0][]
Example Response
{"response_code":200,"message":"success","data":{"items":{"313.5aacb3079ca59":{"uid":"313.5aacb3079ca59","courseId":"1036","name":"Test","email":"test@example.com","enrollment_date":"2018-07-10 04:44:49","start_date":"-","completed_date":"-","status":"In Progress","last_attended":"2018-07-10 04:45:03","completion_percentage":0}},"pagination":{"total_items":2,"items_per_page":"1","page_index":"2","total_pages":2}}}


GET Get Affiliates Brief Report
https://api.newzenler.com/api/v1/reports/affiliates/brief?start_date=&end_date=&limit=&page=&course_ids[]=&affiliate_ids[]
PARAMS

start_date

String - Should be in format YYYY-mm-dd (2018-05-18)

end_date

String - Should be in format YYYY-mm-dd (2018-05-18)

limit

The number of items to be returned. Default: 15 , Type: Number

page

The page within the collection to fetch.Default: 1, Type: Number

course_ids[]

Specify course id

affiliate_ids[]

Specify Affiliate IDs

Example Response
{"response_code":200,"message":"success","data":{"items":[{"currency":"USD","aff_id":"FZHbhb","aff_name":"test 123","aff_email":"test@example.com","total_sales_count":23,"total_commission":"78.01","pending_commission":"78.01","paid_commission":"0.00"}],"pagination":{"total_items":2,"items_per_page":"1","page_index":"1","total_pages":2}}}


GET Get Affiliates Detailed Report
https://api.newzenler.com/api/v1/reports/affiliates/detailed?start_date=&end_date=&limit=&page=&course_ids[]=&affiliate_ids[]&af_v&coupon_is[]&coupon_like[]&name_is[]&name_like[]&email_is[]&email_like[]&affiliate_is[]&payment_type
PARAMS

start_date

String - Should be in format YYYY-mm-dd (2018-05-18)

end_date

String - Should be in format YYYY-mm-dd (2018-05-18)

limit

The number of items to be returned. Default: 15 , Type: Number

page

The page within the collection to fetch.Default: 1, Type: Number

course_ids[]

Specify course id

affiliate_ids[]
af_v

Advanced Filter - Specify 1 for advanced filter

coupon_is[]
coupon_like[]
name_is[]
name_like[]
email_is[]
email_like[]
affiliate_is[]

String - Affiliate ID

payment_type

Number 2 (Subscription) or 3 (One time payment) or 4 (Payment plan)

Example Response
{"response_code":200,"message":"success","data":{"items":[{"course":"test","created_at":"11\/09\/2018","sales_price":"$10.00","coupon_disount":"$0.00","commission":"$0.63","payout_status":"Pending"}],"pagination":{"total_items":14,"items_per_page":1,"page_index":1,"total_pages":14}}}