يُمكن لدائرةٍ ما إضافة و عرض المناسبات الخاصّة بها، هذه المناسبات يُدعى إليها أفراد الدائرة و كذلك يُمكن دعوة أفراد دائرة أخرى، هذه الصفحة خُصّصت لشرح إضافة المناسبات بالتفصيل:
يُمكن إضافة مناسبة من خلال إرسال طلب POST
إلى الرابط التالي:
الطلب | |
---|---|
POST |
{{teenah_api_url}}/events |
|
و الردّ القادم من الخادم سيكون أحد الردود التالية: إمّا 201
أو 400
أو 403
:
الردود | |
---|---|
201 |
{ "message": "The event has been created successfully.", "event_id": 1 } |
|
|
400 |
{ "message": "Bad request." } |
|
|
403 |
{ "message": "Not authroized to use this resource." } |
|
يُمكن للمستخدم الحاليّ جلب و عرض معلومات مناسبةٍ ما إذا كان مدعوّاً إليها من خلال إرسال طلب GET
إلى الرابط التالي:
الطلب | |
---|---|
GET |
{{teenah_api_url}}/events/{id} |
|
و سيكون ردّ الخادم أحد الردود التالية إمّا 200
أو 400
أو 403
:
الردود | |
---|---|
200 |
{ "id": "1", "title": "اجتماع العائلة الشهري", "start_datetime": "2014-01-01 13:00:00", "finish_datetime": "2014-01-01 22:00:00", "location": "الرياض", "latitude": null, "longtitude": null, "created_by": "2", "created_at": "2014-02-08 20:18:01", "updated_at": "2014-02-08 20:18:01", "views_count": "2", "likes_count": "0", "comments_count": "0", "creator": { "id": "2", "gender": "male", "name": "حسام", "fullname": null, "nickname": null, "dob": null, "pob": null, "dod": null, "pod": null, "age": "0", "is_alive": "1", "photo": "https://teenahapp.s3.amazonaws.com/uWY14ohesH4Olco.png", "location": null, "mobile": "966553085572", "email": null, "home_phone": null, "work_phone": null, "marital_status": "", "blood_type": null, "is_root": "0", "tribe_id": null, "created_at": "2014-02-02 17:56:34", "updated_at": "2014-02-05 12:07:30", "social_medias": [ { "id": "1", "social_media": "Twitter", "account": "hossamzee", "url": "https://twitter.com/hossamzee", "created_at": "2014-02-07 22:29:42", "updated_at": "2014-02-07 22:29:42" } ], "updates_count": "0" }, "members": [ { "id": "1", "circle_id": "1", "event_id": "1", "member_id": "2", "decision": "notyet", "created_at": "2014-02-08 20:18:01", "updated_at": "2014-02-08 20:18:01", "member": { "id": "2", "gender": "male", "name": "حسام", "fullname": null, "nickname": null, "dob": null, "pob": null, "dod": null, "pod": null, "age": "0", "is_alive": "1", "photo": "https://teenahapp.s3.amazonaws.com/V2Y14ohesH4Olco.png", "location": null, "mobile": "966553085572", "email": null, "home_phone": null, "work_phone": null, "marital_status": "", "blood_type": null, "is_root": "0", "tribe_id": null, "created_at": "2014-02-02 17:56:34", "updated_at": "2014-02-05 12:07:30", "social_medias": [ { "id": "1", "social_media": "Twitter", "account": "hossamzee", "url": "https://twitter.com/hossamzee", "created_at": "2014-02-07 22:29:42", "updated_at": "2014-02-07 22:29:42" } ], "updates_count": "0" } }, { "id": "2", "circle_id": "1", "event_id": "1", "member_id": "3", "decision": "notyet", "created_at": "2014-02-08 20:18:01", "updated_at": "2014-02-08 20:18:01", "member": { "id": "3", "gender": "male", "name": "علي", "fullname": null, "nickname": null, "dob": null, "pob": null, "dod": null, "pod": null, "age": "0", "is_alive": "1", "photo": null, "location": null, "mobile": "966542048525", "email": null, "home_phone": null, "work_phone": null, "marital_status": "single", "blood_type": null, "is_root": "0", "tribe_id": null, "created_at": "2014-02-05 13:13:17", "updated_at": "2014-02-05 13:13:17", "social_medias": [], "updates_count": "0" } } ], "medias": [ { "id": "1", "event_id": "1", "media_id": "1", "created_at": "0000-00-00 00:00:00", "updated_at": "0000-00-00 00:00:00", "media": { "id": "1", "category": "image", "taste": null, "url": "https://teenahapp.s3.amazonaws.com/0bwzy5tTrkExVOS.png", "created_by": "1", "created_at": "2014-01-25 07:50:21", "updated_at": "2014-01-25 07:50:21" } } ] } |
|
|
400 |
{ "message": "Bad request." } |
|
|
403 |
{ "message": "Not authroized to use this resource." } |
|
يُمكن للفرد الذي أنشأ مناسبةً ما أن يقوم بتحديث المناسبة من خلال تغيير العنوان للمناسبة أو مكانها أو غيرها، و ذلك من خلال إرسال طلب PUT
إلى الرابط التالي:
الطلب | |
---|---|
PUT |
{{teenah_api_url}}/events/{id} |
|
و سيكون ردّ الخادم أحد الردود التالية: إمّا 204
أو 400
أو 403
أو 404
:
الردود | |
---|---|
204 | |
400 |
{ "message": "Bad request." } |
|
|
403 |
{ "message": "Not authroized to use this resource." } |
|
|
404 |
{ "message": "The event is not found." } |
|
يُمكن للفرد الذي أنشأ مناسبة أن يقوم بحذفها و ذلك من خلال إرسال طلب DELETE
إلى الرابط التالي:
الطلب | |
---|---|
DELETE |
{{teenah_api_url}}/events/{id} |
|
و ردّ الخادم سيكون أحد الردود التالية: إمّا 204
أو 403
أو 404
:
الردود | |
---|---|
204 | |
403 |
{ "message": "Not authroized to use this resource." } |
|
|
404 |
{ "message": "The event is not found." } |
|
الطلب | |
---|---|
PUT |
{{teenah_api_url}}/events/{id}/medias |
|
يُمكن للمستخدم الحاليّ أن يقرّر ما إذا كان سيحضر مناسبةً ما أو سيعتذر، كل ذلك يتمّ من خلال إرساله طلب PUT
إلى الرابط التاليّ:
الطلب | |
---|---|
PUT |
{{teenah_api_url}}/events/{id}/decision/{decision} |
|
و سيكون ردّ الخادم أحد الردود التالية: إمّا 204
أو 400
أو 403
:
الردود | |
---|---|
204 | |
400 |
{ "message": "Bad request." } |
|
|
403 |
{ "message": "Not authroized to use this resource." } |
|
يُمكن للمستخدم أن يعرض قراره الذي اتّخذه بشأن مناسبةٍ ما من خلال إرسال طلب إلى الرابط:
الطلب | |
---|---|
GET |
{{teenah_api_url}}/events/{id}/decision |
|
و ردّ الخادم سيكون أحد الردود التالية: إمّا 200
أو 400
أو 403
:
الردود | |
---|---|
200 |
{ "decision": "willcome" } |
|
|
400 |
{ "message": "Bad request." } |
|
|
403 |
{ "message": "Not authroized to use this resource." } |
|
يُمكن للمستخدم الحاليّ إبداء إعجابه بأحد المناسبات التي تمّ دعوته إليها من خلال إرسال طلب GET
إلى الرابط التالي:
الطلب | |
---|---|
GET |
{{teenah_api_url}}/events/{id}/like |
|
و ردّ الخادم سيكون أحد الردود التالية: إمّا 204
أو 403
:
الردود | |
---|---|
204 | |
403 |
{ "message": "Not authroized to use this resource." } |
|
يُمكن للمستخدم الحاليّ أن يعلّق على أيٍّ من المناسبات التي يمكنه الوصول إليها من خلال إرسال طلب POST
إلى الرابط التالي:
الطلب | |
---|---|
POST |
{{teenah_api_url}}/events/{id}/comment |
|
و ردّ الخادم سيكون أحد الردود التالية: إمّا 204
أو 400
أو 403
:
الردود | |
---|---|
204 | |
400 |
{ "message": "Bad request." } |
|
|
403 |
{ "message": "Not authroized to use this resource." } |
|
كما يُمكن للمستخدم الحاليّ الإعجاب بتعليق فردٍ من الأفراد على أيٍّ من الوسائط المتعدّدة من خلال إرسال طلب GET
إلى الرابط التالي:
الطلب | |
---|---|
GET |
{{teenah_api_url}}/events/{event_id}/comments/{comment_id}/like |
|
و ردّ الخادم سيكون أحد الردود التالية: إمّا 204
أو 403
:
الردود | |
---|---|
204 | |
403 |
{ "message": "Not authroized to use this resource." } |
|