مستندات API آموزش سازمانی
سامانه منابع انسانی و آموزش سازمان را به کارکنان، پیشرفت آموزشی، نتایج آزمون، گواهیها و رویدادهای یادگیری نماتک متصل کنید. هر کلید فقط اطلاعات سازمان صادرکننده خود را در اختیار میگذارد.
این راهنما عمومی است. نمونهها ساختگیاند و برای نمایش مستندات نیازی به واردکردن کلید نیست. اجرای عملیات API به کلید معتبر نیاز دارد.
شروع اتصال
- مالک پنل از «تنظیمات سازمان ← API آموزش سازمانی» یک کلید با دسترسی لازم بسازد.
- کلید را در تنظیمات محرمانه سامانه خود ذخیره و فقط در هدر Authorization ارسال کنید.
- برای نخستین بررسی اتصال، فهرست کارکنان را دریافت کنید.
نشانی پایه
https://namatek.com/api/company/v1/نمونه درخواست خواندن
curl --request GET \
'https://namatek.com/api/company/v1/employees/?limit=50' \
--header 'Authorization: Bearer YOUR_ORGANIZATION_API_KEY'نشانیها باید اسلش پایانی داشته باشند. بدنه درخواستهای نوشتن JSON است؛ زمانها با ISO 8601، مدتها بر حسب ثانیه و نمره و پیشرفت از صفر تا صد ارائه میشوند.
کلید و دسترسیها
| مجوز | کاربرد |
|---|---|
employees:read | دریافت فهرست و اطلاعات کارکنان |
employees:write | افزودن و بهروزرسانی کارکنان همین سازمان |
learning:read | دریافت پیشرفت، نتایج آزمون و گواهیها |
events:read | دریافت رویدادهای یادگیری |
کلیدهای ساختهشده از پنل بهصورت پیشفرض مجوز خواندن دارند. افزودن و ویرایش کارکنان به انتخاب صریح مالک نیاز دارد. حداکثر ۱۰ کلید فعال و اعتبار یک تا ۳۶۵ روز مجاز است؛ کلید فقط هنگام ساخت نمایش داده میشود.
شناسه سازمان از کلید تعیین میشود و ورودی companyId پذیرفته نمیشود. تغییر اطلاعات کارکنان فقط عضویت همین سازمان را تغییر میدهد؛ شماره موبایل، پروفایل شخصی، نقشها و تخصیص دوره از این API قابل تغییر نیستند.
نتایج قدیمی آزمون با منشا سازمانی نامشخص در این API نمایش داده نمیشوند. پیشرفت هم فقط از مشاهده منتسب به همین سازمان محاسبه میشود و ممکن است با مجموع پیشرفت شخصی کارمند تفاوت داشته باشد.
مسیرهای API
هر مسیر را باز کنید تا مجوز، توضیح و قرارداد دقیق درخواست و پاسخ آن را ببینید.
GET/employees/فهرست کارکنان
فهرست کارکنان فعال و غیرفعال همین سازمان، همراه با نام نمایشی، کد پرسنلی و عنوان شغلی.
مجوز لازم: employees:read
{
"summary": "List employees",
"description": "Organization-owned employee fields, including inactive members. Personal profile fields are not exposed.",
"x-required-scope": "employees:read",
"parameters": [
{
"name": "cursor",
"in": "query",
"schema": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"default": "0"
}
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
}
},
{
"name": "employeeId",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"companyId": {
"type": "integer",
"minimum": 1
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Employee"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
}
}
}
},
"400": {
"description": "HTTP 400",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "HTTP 401",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "HTTP 403",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "HTTP 404",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "HTTP 413",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "HTTP 415",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "HTTP 429",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "HTTP 503",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}POST/employees/افزودن یا بهروزرسانی کارمند
شماره موبایل شناسه تطبیق است. تکرار درخواست کارمند تکراری نمیسازد و فیلدهای ارسالنشده را تغییر نمیدهد.
مجوز لازم: employees:write
{
"summary": "Create or update an employee by mobile",
"x-required-scope": "employees:write",
"description": "Idempotent upsert by normalized Iranian mobile. Omitted fields are preserved for existing employees. A new employee defaults to active. Only this organization's fields change.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EmployeeCreate"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"companyId": {
"type": "integer",
"minimum": 1
},
"data": {
"$ref": "#/components/schemas/Employee"
}
}
}
}
}
},
"400": {
"description": "HTTP 400",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "HTTP 401",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "HTTP 403",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "HTTP 404",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "HTTP 413",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "HTTP 415",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "HTTP 429",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "HTTP 503",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}GET/employees/{id}/اطلاعات یک کارمند
شناسه id همان شناسه عضویت کارمند در سازمان است. شناسه ناموجود یا متعلق به سازمان دیگر پاسخ 404 میگیرد.
مجوز لازم: employees:read
{
"summary": "Get one employee",
"x-required-scope": "employees:read",
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"companyId": {
"type": "integer",
"minimum": 1
},
"data": {
"$ref": "#/components/schemas/Employee"
}
}
}
}
}
},
"400": {
"description": "HTTP 400",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "HTTP 401",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "HTTP 403",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "HTTP 404",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "HTTP 413",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "HTTP 415",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "HTTP 429",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "HTTP 503",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}PATCH/employees/{id}/ویرایش اطلاعات سازمانی کارمند
نام نمایشی، کد پرسنلی، عنوان شغلی و وضعیت فعالیت قابل تغییرند. null فیلد متنی را خالی میکند؛ غیرفعالکردن سابقه آموزشی را پاک نمیکند.
مجوز لازم: employees:write
{
"summary": "Update organization-owned fields",
"x-required-scope": "employees:write",
"description": "At least one field is required. null clears a text field. The mobile identity cannot be changed. isActive=false suspends this organization's access without deleting history.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EmployeePatch"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"companyId": {
"type": "integer",
"minimum": 1
},
"data": {
"$ref": "#/components/schemas/Employee"
}
}
}
}
}
},
"400": {
"description": "HTTP 400",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "HTTP 401",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "HTTP 403",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "HTTP 404",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "HTTP 413",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "HTTP 415",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "HTTP 429",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "HTTP 503",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}GET/progress/پیشرفت آموزشی
پیشرفت هر تخصیص دوره از بازههای مشاهده منتسب به همین سازمان محاسبه میشود. تماشای تکراری یک بازه، پیشرفت را افزایش نمیدهد.
مجوز لازم: learning:read
{
"summary": "Course progress",
"description": "Unique watched ranges from sessions explicitly attributed to this organization's enrollment. Progress is the share of completed lessons (90% unique lesson coverage). Personal and other-employer watching is excluded; values can differ from the learner's combined dashboard.",
"x-required-scope": "learning:read",
"parameters": [
{
"name": "cursor",
"in": "query",
"schema": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"default": "0"
}
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
}
},
{
"name": "employeeId",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "courseId",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"companyId": {
"type": "integer",
"minimum": 1
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Progress"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
}
}
}
},
"400": {
"description": "HTTP 400",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "HTTP 401",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "HTTP 403",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "HTTP 404",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "HTTP 413",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "HTTP 415",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "HTTP 429",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "HTTP 503",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}GET/results/نتایج آزمون
نمره، نوبت شرکت و نتیجه آزمونهای پایانیافته با انتساب صریح سازمانی. تا پایان بازبینی آزمون تحت نظارت، isPassed میتواند null باشد.
مجوز لازم: learning:read
{
"summary": "Completed assessment results",
"description": "Includes a nullable pass state while proctor review is pending. Only results with an explicit organization enrollment are returned. No questions, answers, camera images or identity documents are exposed.",
"x-required-scope": "learning:read",
"parameters": [
{
"name": "cursor",
"in": "query",
"schema": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"default": "0"
}
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
}
},
{
"name": "employeeId",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "courseId",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"companyId": {
"type": "integer",
"minimum": 1
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Result"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
}
}
}
},
"400": {
"description": "HTTP 400",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "HTTP 401",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "HTTP 403",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "HTTP 404",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "HTTP 413",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "HTTP 415",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "HTTP 429",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "HTTP 503",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}GET/certificates/گواهیها
آزمونهای نهایی قبولشده با شماره گواهی و انتساب سازمانی مشخص. این مسیر اطلاعات گواهی موجود را میدهد و گواهی جدید صادر نمیکند.
مجوز لازم: learning:read
{
"summary": "Certificates",
"description": "Passed final assessments with a certificate serial and explicit organization enrollment. Does not issue a certificate or grant access.",
"x-required-scope": "learning:read",
"parameters": [
{
"name": "cursor",
"in": "query",
"schema": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"default": "0"
}
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
}
},
{
"name": "employeeId",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "courseId",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"companyId": {
"type": "integer",
"minimum": 1
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Result"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
}
}
}
},
"400": {
"description": "HTTP 400",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "HTTP 401",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "HTTP 403",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "HTTP 404",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "HTTP 413",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "HTTP 415",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "HTTP 429",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "HTTP 503",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}GET/events/رویدادهای یادگیری
رویدادهای پایدار پایان مشاهده، پایان و بازبینی آزمون، صدور و لغو گواهی. برای همگامسازی پیوسته از checkpoint استفاده کنید.
مجوز لازم: events:read
{
"summary": "Poll learning events",
"description": "Durable events recorded after this feature is installed. Store checkpoint only after processing the page and pass it as the next cursor, including when hasMore=false. Deduplicate by event id. Continue polling even after an empty page. Event snapshots remain immutable; certificate.revoked supersedes an earlier issuance.",
"x-required-scope": "events:read",
"parameters": [
{
"name": "cursor",
"in": "query",
"schema": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"default": "0"
}
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
}
},
{
"name": "employeeId",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "courseId",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"companyId": {
"type": "integer",
"minimum": 1
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Event"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
},
"checkpoint": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "HTTP 400",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "HTTP 401",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "HTTP 403",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "HTTP 404",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "HTTP 413",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "HTTP 415",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "HTTP 429",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "HTTP 503",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}ساختار دادهها
نام فیلدها و محدودیتها از همان قرارداد OpenAPI گرفته میشوند. برای ایجاد کارمند mobile لازم است؛ ویرایش باید حداقل یک فیلد داشته باشد. فیلدهای ناشناخته رد میشوند.
کارمند Employee
| فیلد | نوع | توضیح و محدودیت |
|---|---|---|
id | integer | شناسه رکورد؛ در پیشرفت، شناسه تخصیص دوره است. |
mobile | string | شماره موبایل ایران؛ در خروجی با صفر ابتدایی نمایش داده میشود. |
displayName | string | null | نام نمایشی ثبتشده توسط سازمان. حداکثر ۲۰۰ نویسه. |
personnelCode | string | null | کد پرسنلی سازمان. حداکثر ۵۰ نویسه. |
jobTitle | string | null | عنوان شغلی در سازمان. حداکثر ۲۰۰ نویسه. |
isActive | boolean | وضعیت فعالیت عضویت؛ false دسترسی سازمانی این کارمند را متوقف میکند. |
joinedAt | string | null (date-time) | زمان عضویت در سازمان. |
deactivatedAt | string | null (date-time) | زمان غیرفعالشدن؛ برای عضویت فعال null است. |
ورودی افزودن کارمند EmployeeCreate
| فیلد | نوع | توضیح و محدودیت |
|---|---|---|
mobileالزامی | string | شماره موبایل ایران؛ در خروجی با صفر ابتدایی نمایش داده میشود. حداکثر ۳۰ نویسه. |
displayName | string | null | نام نمایشی ثبتشده توسط سازمان. حداکثر ۲۰۰ نویسه. |
personnelCode | string | null | کد پرسنلی سازمان. حداکثر ۵۰ نویسه. |
jobTitle | string | null | عنوان شغلی در سازمان. حداکثر ۲۰۰ نویسه. |
isActive | boolean | وضعیت فعالیت عضویت؛ false دسترسی سازمانی این کارمند را متوقف میکند. |
ورودی ویرایش کارمند EmployeePatch
| فیلد | نوع | توضیح و محدودیت |
|---|---|---|
displayName | string | null | نام نمایشی ثبتشده توسط سازمان. حداکثر ۲۰۰ نویسه. |
personnelCode | string | null | کد پرسنلی سازمان. حداکثر ۵۰ نویسه. |
jobTitle | string | null | عنوان شغلی در سازمان. حداکثر ۲۰۰ نویسه. |
isActive | boolean | وضعیت فعالیت عضویت؛ false دسترسی سازمانی این کارمند را متوقف میکند. |
پیشرفت دوره Progress
| فیلد | نوع | توضیح و محدودیت |
|---|---|---|
id | integer | شناسه رکورد؛ در پیشرفت، شناسه تخصیص دوره است. |
employeeId | integer | شناسه عضویت کارمند در همین سازمان. |
courseId | integer | شناسه دوره. |
courseTla | string | کد دوره. |
courseTitle | string | عنوان دوره. |
statusId | integer | شناسه وضعیت تخصیص دوره. |
startsAt | string | null (date-time) | آغاز بازه دسترسی. |
expiresAt | string | null (date-time) | پایان بازه دسترسی؛ null یعنی بدون تاریخ انقضا. |
totalLessons | integer | تعداد کل درسهای دوره. |
completedLessons | integer | درسهای تکمیلشده از مشاهده سازمانی. |
watchedSeconds | integer | مجموع ثانیههای یکتای مشاهده سازمانی. |
progressPercent | integer | درصد درسهای تکمیلشده از کل درسها. |
lastActivityAt | string | null (date-time) | زمان آخرین مشاهده ثبتشده برای همین تخصیص. |
نتیجه آزمون و گواهی Result
| فیلد | نوع | توضیح و محدودیت |
|---|---|---|
id | integer | شناسه رکورد؛ در پیشرفت، شناسه تخصیص دوره است. |
employeeId | integer | شناسه عضویت کارمند در همین سازمان. |
enrollmentId | integer | شناسه تخصیص سازمانی دوره. |
courseId | integer | شناسه دوره. |
courseTla | string | کد دوره. |
courseTitle | string | عنوان دوره. |
assessmentType | string | نوع ارزیابی: پیشآزمون، آزمون نهایی یا نظرسنجی.PreExam / Exam / Survey |
attemptNumber | integer | شماره نوبت شرکت. |
score | integer | null | نمره از صفر تا صد. |
isPassed | boolean | null | نتیجه قبولی؛ null میتواند نشاندهنده انتظار برای بازبینی باشد. |
startedAt | string | null (date-time) | زمان آغاز آزمون. |
endedAt | string | null (date-time) | زمان پایان آزمون. |
certificateSerial | string | null | شماره گواهی؛ اگر گواهی ندارد null است. |
رویداد یادگیری Event
| فیلد | نوع | توضیح و محدودیت |
|---|---|---|
id | integer | شناسه رکورد؛ در پیشرفت، شناسه تخصیص دوره است. |
employeeId | integer | شناسه عضویت کارمند در همین سازمان. |
enrollmentId | integer | شناسه تخصیص سازمانی دوره. |
courseId | integer | شناسه دوره. |
type | string | نوع رویداد.learning.session_completed / assessment.completed / assessment.reviewed / certificate.issued / certificate.revoked |
data | object | محتوای رویداد طبق جدول پایین. |
occurredAt | string | null (date-time) | زمان رخدادن رویداد. |
recordedAt | string | null (date-time) | زمان ثبت رویداد در سامانه. |
صفحهبندی Pagination
| فیلد | نوع | توضیح و محدودیت |
|---|---|---|
hasMore | boolean | اگر true باشد صفحه بعدی وجود دارد. |
nextCursor | string | null | مقدار cursor برای صفحه بعد؛ در آخرین صفحه null است. |
خطا Error
| فیلد | نوع | توضیح و محدودیت |
|---|---|---|
error | object | شیئی شامل code و message برای تشخیص خطا. |
صفحهبندی و رویدادها
فهرستها به ترتیب شناسه صعودیاند. limit پیشفرض ۵۰ و حداکثر ۱۰۰ است؛ cursor از صفر شروع میشود. برای فیلتر از employeeId و در مسیرهای آموزشی از courseId استفاده کنید.
{
"companyId": 1,
"data": [],
"pagination": {
"hasMore": false,
"nextCursor": null
}
}تا وقتی hasMore برابر true است، nextCursor را در درخواست بعد بفرستید. این فهرستها وضعیت فعلیاند؛ برای تغییرات بعدی از events استفاده کنید. در پاسخ رویدادها، checkpoint را پس از پردازش موفق صفحه ذخیره و بهعنوان cursor بعدی ارسال کنید، حتی اگر hasMore برابر false باشد.
با شناسه رویداد از پردازش تکراری جلوگیری کنید. checkpoint را میان دو سازمان یا دو مجموعه فیلتر مشترک نکنید. رویدادها از زمان فعالشدن این قابلیت ثبت میشوند.
| رویداد | فیلدهای data |
|---|---|
learning.session_completed | sessionId, lessonId, playedSeconds |
assessment.completed | resultId, assessmentType, score, isPassed |
assessment.reviewed | resultId, assessmentType, score, isPassed |
certificate.issued / certificate.revoked | resultId, serial |
خطاها و محدودیتها
هر کلید حداکثر ۱۲۰ درخواست در دقیقه دارد. محدودیت تکمیلی هر IP برابر ۶۰۰ درخواست در دقیقه است. در پاسخ 429، هدر Retry-After مدت انتظار را بر حسب ثانیه مشخص میکند.
{
"error": {
"code": "insufficient_scope",
"message": "کلید API این سطح دسترسی را ندارد."
}
}| وضعیت | معنی و اقدام |
|---|---|
| 400 | ورودی نامعتبرپارامتر ناشناخته یا تکراری، فیلد نامعتبر یا بدنه JSON نادرست. |
| 401 | کلید نامعتبرکلید ارسال نشده، منقضی یا لغو شده، یا دسترسی صادرکننده آن برقرار نیست. |
| 403 | دسترسی ناکافیکلید مجوز این عملیات را ندارد. |
| 404 | کارمند پیدا نشدشناسه کارمند وجود ندارد یا به این سازمان تعلق ندارد. |
| 413 | بدنه بزرگتر از حد مجازحداکثر اندازه بدنه درخواست ۱۶ کیلوبایت است. |
| 415 | قالب بدنه نادرستبرای نوشتن اطلاعات، Content-Type باید application/json باشد. |
| 429 | درخواست بیش از حدپس از مدت اعلامشده در Retry-After دوباره تلاش کنید. |
| 503 | عدم دسترسی موقتبا فاصله افزایشی و تعداد محدود دوباره تلاش کنید. |
