Skip to content

Instantly share code, notes, and snippets.

@aman0511
Last active September 29, 2016 07:22
Show Gist options
  • Select an option

  • Save aman0511/2bdfa6adc0ea1f0a0ef604b2cefb1c22 to your computer and use it in GitHub Desktop.

Select an option

Save aman0511/2bdfa6adc0ea1f0a0ef604b2cefb1c22 to your computer and use it in GitHub Desktop.
Account:
Register User:
--------------------------
Method: POST
End Point: /accounts/user/
data = {
"name": "",
"email": "",
"password": "",
"role": null
}
Login User
------------------
End Point: /accounts/login/
data ={
"password": "",
"email": ""
}
Logout User:
--------------------------
Method: POST
End Point: /accounts/logout/
data: {}
Create Campaigin:
---------------------------
Method: Post
End Point: /campaign/
{
"id": 8,
"media": [],
"questions": [
{
"id": 4,
"options": [
{
"id": 2,
"option_text": "option 1",
"order": 1,
"is_answer": true,
"created": "2016-09-29T06:59:29.991427Z"
}
],
"question_text": "test1",
"order": 1,
"created": "2016-09-29T06:59:29.973126Z"
}
],
"location": {
"type": "Point",
"coordinates": [
15.8203125,
5.2734375
]
},
"title": "a;lfksa;ldf",
"brand": "sdf;lsadkf",
"short_description": "safd.as;kdf;",
"detail_description": "sdaf;lsadf",
"website_descriptions": "sdfl;sadfkpsdf",
"logo_image": null,
"facebook_link": "",
"instagram_link": "",
"twitter_link": "",
"website_link": "",
"apple_app_store_link": "",
"google_play_store_link": "",
"category": "1",
"media_display_category": "1",
"media_type": "1",
"status": "3",
"is_validation_required": true,
"contact_number": "",
"created": "2016-09-29T06:59:29.897589Z",
"modified": "2016-09-29T06:59:29.897622Z",
"company": 1
}
List Of Campaign:
-----------------------------
METHOD: GET
API: /inventory/
Filter Params: status, compnay,
response:
[
{
"id": 2,
"media": [],
"questions": [],
"location": {
"type": "Point",
"coordinates": [
15.8203125,
5.2734375
]
},
"title": "a;lfksa;ldf",
"brand": "sdf;lsadkf",
"short_description": "safd.as;kdf;",
"detail_description": "sdaf;lsadf",
"website_descriptions": "sdfl;sadfkpsdf",
"logo_image": "http://localhost:8001/campaign/Screenshot_from_2016-08-26_15-39-24_Xt58FYi.png",
"facebook_link": "",
"instagram_link": "",
"twitter_link": "",
"website_link": "",
"apple_app_store_link": "",
"google_play_store_link": "",
"category": "1",
"media_display_category": "1",
"media_type": "1",
"status": "3",
"is_validation_required": true,
"contact_number": "",
"created": "2016-09-26T10:44:40.825137Z",
"modified": "2016-09-26T10:44:40.825171Z",
"company": 1
},
{
"id": 3,
"media": [],
"questions": [],
"location": {
"type": "Point",
"coordinates": [
15.8203125,
5.2734375
]
},
"title": "a;lfksa;ldf",
"brand": "sdf;lsadkf",
"short_description": "safd.as;kdf;",
"detail_description": "sdaf;lsadf",
"website_descriptions": "sdfl;sadfkpsdf",
"logo_image": null,
"facebook_link": "",
"instagram_link": "",
"twitter_link": "",
"website_link": "",
"apple_app_store_link": "",
"google_play_store_link": "",
"category": "1",
"media_display_category": "1",
"media_type": "1",
"status": "3",
"is_validation_required": true,
"contact_number": "",
"created": "2016-09-29T06:47:42.121855Z",
"modified": "2016-09-29T06:47:42.121912Z",
"company": 1
},
{
"id": 4,
"media": [],
"questions": [],
"location": {
"type": "Point",
"coordinates": [
15.8203125,
5.2734375
]
},
"title": "a;lfksa;ldf",
"brand": "sdf;lsadkf",
"short_description": "safd.as;kdf;",
"detail_description": "sdaf;lsadf",
"website_descriptions": "sdfl;sadfkpsdf",
"logo_image": null,
"facebook_link": "",
"instagram_link": "",
"twitter_link": "",
"website_link": "",
"apple_app_store_link": "",
"google_play_store_link": "",
"category": "1",
"media_display_category": "1",
"media_type": "1",
"status": "3",
"is_validation_required": true,
"contact_number": "",
"created": "2016-09-29T06:50:58.765355Z",
"modified": "2016-09-29T06:50:58.765384Z",
"company": 1
},
{
"id": 5,
"media": [],
"questions": [],
"location": {
"type": "Point",
"coordinates": [
15.8203125,
5.2734375
]
},
"title": "a;lfksa;ldf",
"brand": "sdf;lsadkf",
"short_description": "safd.as;kdf;",
"detail_description": "sdaf;lsadf",
"website_descriptions": "sdfl;sadfkpsdf",
"logo_image": null,
"facebook_link": "",
"instagram_link": "",
"twitter_link": "",
"website_link": "",
"apple_app_store_link": "",
"google_play_store_link": "",
"category": "1",
"media_display_category": "1",
"media_type": "1",
"status": "3",
"is_validation_required": true,
"contact_number": "",
"created": "2016-09-29T06:52:08.665880Z",
"modified": "2016-09-29T06:52:08.665985Z",
"company": 1
},
{
"id": 6,
"media": [],
"questions": [],
"location": {
"type": "Point",
"coordinates": [
15.8203125,
5.2734375
]
},
"title": "a;lfksa;ldf",
"brand": "sdf;lsadkf",
"short_description": "safd.as;kdf;",
"detail_description": "sdaf;lsadf",
"website_descriptions": "sdfl;sadfkpsdf",
"logo_image": null,
"facebook_link": "",
"instagram_link": "",
"twitter_link": "",
"website_link": "",
"apple_app_store_link": "",
"google_play_store_link": "",
"category": "1",
"media_display_category": "1",
"media_type": "1",
"status": "3",
"is_validation_required": true,
"contact_number": "",
"created": "2016-09-29T06:52:34.594728Z",
"modified": "2016-09-29T06:52:34.594762Z",
"company": 1
},
{
"id": 7,
"media": [],
"questions": [
{
"id": 3,
"options": [
{
"id": 1,
"option_text": "option 1",
"order": 1,
"is_answer": true,
"created": "2016-09-29T06:58:10.981958Z"
}
],
"question_text": "test1",
"order": 1,
"created": "2016-09-29T06:58:10.973694Z"
}
],
"location": {
"type": "Point",
"coordinates": [
15.8203125,
5.2734375
]
},
"title": "a;lfksa;ldf",
"brand": "sdf;lsadkf",
"short_description": "safd.as;kdf;",
"detail_description": "sdaf;lsadf",
"website_descriptions": "sdfl;sadfkpsdf",
"logo_image": null,
"facebook_link": "",
"instagram_link": "",
"twitter_link": "",
"website_link": "",
"apple_app_store_link": "",
"google_play_store_link": "",
"category": "1",
"media_display_category": "1",
"media_type": "1",
"status": "3",
"is_validation_required": true,
"contact_number": "",
"created": "2016-09-29T06:58:10.893249Z",
"modified": "2016-09-29T06:58:10.893277Z",
"company": 1
},
{
"id": 8,
"media": [],
"questions": [
{
"id": 4,
"options": [
{
"id": 2,
"option_text": "option 1",
"order": 1,
"is_answer": true,
"created": "2016-09-29T06:59:29.991427Z"
}
],
"question_text": "test1",
"order": 1,
"created": "2016-09-29T06:59:29.973126Z"
}
],
"location": {
"type": "Point",
"coordinates": [
15.8203125,
5.2734375
]
},
"title": "a;lfksa;ldf",
"brand": "sdf;lsadkf",
"short_description": "safd.as;kdf;",
"detail_description": "sdaf;lsadf",
"website_descriptions": "sdfl;sadfkpsdf",
"logo_image": null,
"facebook_link": "",
"instagram_link": "",
"twitter_link": "",
"website_link": "",
"apple_app_store_link": "",
"google_play_store_link": "",
"category": "1",
"media_display_category": "1",
"media_type": "1",
"status": "3",
"is_validation_required": true,
"contact_number": "",
"created": "2016-09-29T06:59:29.897589Z",
"modified": "2016-09-29T06:59:29.897622Z",
"company": 1
},
{
"id": 9,
"media": [],
"questions": [
{
"id": 5,
"options": [
{
"id": 3,
"option_text": "option 1",
"order": 1,
"is_answer": true,
"created": "2016-09-29T07:10:35.226720Z"
}
],
"question_text": "test1",
"order": 1,
"created": "2016-09-29T07:10:35.208967Z"
}
],
"location": {
"type": "Point",
"coordinates": [
15.8203125,
5.2734375
]
},
"title": "a;lfksa;ldf",
"brand": "sdf;lsadkf",
"short_description": "safd.as;kdf;",
"detail_description": "sdaf;lsadf",
"website_descriptions": "sdfl;sadfkpsdf",
"logo_image": null,
"facebook_link": "",
"instagram_link": "",
"twitter_link": "",
"website_link": "",
"apple_app_store_link": "",
"google_play_store_link": "",
"category": "1",
"media_display_category": "1",
"media_type": "1",
"status": "3",
"is_validation_required": true,
"contact_number": "",
"created": "2016-09-29T07:10:35.173258Z",
"modified": "2016-09-29T07:10:35.173287Z",
"company": 1
}
]
Update Campaign
---------------------
Method: PATCH
endpoint: /campaign/3/
data: //field that will get modify
ex- {"status": "2"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment