api.ayat.com/v1/programs
Post
{
"program_name": "<Name example>",
"prerequisite": [
{
"public_program_id": "e885f927-2b95-4a27-b1c4-223d21f429d0"
},
{
"public_program_id": "e885f927-2b95-4a27-b1c4-223d21f429d0"
}
],
"program_level": "<Difficulty>",
"program_category": [
{
"type": "tessxt"
},
{
"type": "tesss2xt"
}
],
"price": "551",
"program_pic": "<Pic>",
"FAQ": [
{
"question": "Text",
"answer": "Text"
},
{
"question": "Text",
"answer": "Text"
}
],
"program_cover": "<Local pic>",
"Program_description": "text example",
"available": true,
"is_open_to_public": true,
"start_date" : "2015-05-05",
"end_date" : "2015-05-05",
"requirement":{
"min_age": 5,
"max_age": 20,
"gender" : false},
"skills":[
{"name" : "sdf"},
{"name":"hello"}
]
}
{
"status": "created",
"program_public_id": "e903928c-9a4c-43ca-aa56-12de83fde5a9",
}
{
"status": "Forbidden"
}
api.ayat.com/v1/programs/{id}
PUT
{
"x-access-token": "fg5562ase84c4",
"program_name": "<Name example>",
"prerequisite": [
{
"public_program_id": "e885f927-2b95-4a27-b1c4-223d21f429d0"
},
{
"public_program_id": "e885f927-2b95-4a27-b1c4-223d21f429d0"
}
],
"program_level": "<Difficulty>",
"program_category": [
{
"type": "tessxt"
},
{
"type": "tesss2xt"
}
],
"price": "551",
"program_pic": "<Pic>",
"FAQ": [
{
"question": "Text",
"answer": "Text"
},
{
"question": "Text",
"answer": "Text"
}
],
"program_cover": "<Local pic>",
"Program_description": "text example",
"available": true,
"is_open_to_public": true,
"start_date" : "2015-05-05",
"end_date" : "2015-05-05",
"requirement":{
"min_age": 5,
"max_age": 20,
"gender" : false},
"skills":[
{"name" : "sdf"},
{"name":"hello"}
]
}
code: 200
{
"status": "edited"
}
{
"status": "Forbidden"
}
api.ayat.com/v1/programs/{id}
GET
{}
{
"FAQ": [
{
"answer": "Text",
"question": "Text"
},
{
"answer": "Text",
"question": "Text"
}
],
"Program_description": "text example",
"available": true,
"end_date": "Tue, 05 May 2015 00:00:00 GMT",
"is_open_to_public": true,
"prerequisite": [
{"public_program_id":"public_program_id example"},
{"public_program_id":"public_program_id example"}
],
"price": "551",
"program_category": [
{
"type": "tessxt"
},
{
"type": "tesss2xt"
}
],
"program_cover": "<Local pic>",
"program_level": "<Difficulty>",
"program_name": "<Name example>",
"program_pic": "<Pic>",
"public_program_id": "c8a3608e-bf88-489a-ae63-4e849330d5d6",
"requirement": {
"requirement": {
"gender": false,
"max_age": 20,
"min_age": 5
}
},
"skills": [
{
"name": "sdf"
},
{
"name": "hello"
}
],
"start_date": "Tue, 05 May 2015 00:00:00 GMT"
}
{
"status": "Content not found"
}
api.ayat.com/v1/programs
GET
{
"programs": [
{
"Program_description": "text example",
"available": true,
"end_date": "Tue, 05 May 2015 00:00:00 GMT",
"is_open_to_public": true,
"price": "551",
"program_category": [
{
"type": "tessxt"
},
{
"type": "tesss2xt"
}
],
"program_cover": "<Local pic>",
"program_level": "<Difficulty>",
"program_name": "<Name example>",
"program_pic": "<Pic>",
"public_program_id": "62eb63f1-e4d9-41b8-a1dd-fc6ecbee9807",
"start_date": "Tue, 05 May 2015 00:00:00 GMT"
},
{
"Program_description": "text example",
"available": true,
"end_date": "Tue, 05 May 2015 00:00:00 GMT",
"is_open_to_public": true,
"price": "551",
"program_category": [
{
"type": "tessxt"
},
{
"type": "tesss2xt"
}
],
"program_cover": "<Local pic>",
"program_level": "<Difficulty>",
"program_name": "<Name example>",
"program_pic": "<Pic>",
"public_program_id": "c8a3608e-bf88-489a-ae63-4e849330d5d6",
"start_date": "Tue, 05 May 2015 00:00:00 GMT"
}
api.ayat.com/v1/programs/{id}
DELETE
{
"x-access-token": "adfgv5erw85s3",
}
{
"status": "Deleted"
}
{
"status": "Forbidden"
}
or
{
"status": "program not found"
}
api.ayat.com/v1/programs/{id}/enrollments
POST
{
"x-access-token": "adfgv5erw85s3",
"public_program_id": "{id}"
}
{
"status": "enrolled"
}
{
"error": "'User is already subscribed"
}
or
{
"error": "you are a staff member"
}
api.ayat.com/v1/programs/{id}/enrollments
DELETE
{
"x-access-token": "adfgv5erw85s3",
}
{
"status": "success"
}
{
"error": "User not enrolled "
}