-Run following commands
-1. open terminal
-2. cd your_own_directory
-3. RUN - gitclone git@github.com:parmeet10/zocket.git
-4. cd zocket
-5. npm install
-6. npm start
http://localhost:3000/authenticationhttp://localhost:3000/productshttp://localhost:3000/platformshttp://localhost:3000/campaigns
The reachability of the host can be checked through the Ping API. The API responds with a pong to communicate availability to the requesting client.
GET
/ping
None
None
None
String
pong
provides token to access other API'S, gives better control and accessibility over the api's
GET
/authentication
None
None
None
JSON
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjoiU2F0IE9jdCAwOCAyMDIyIDIyOjQzOjU4IEdNVCswNTMwIChJbmRpYSBTdGFuZGFyZCBUaW1lKSIsImlhdCI6MTY2NTI0OTIzOH0.x1sGFnw51ibu5nqD3uaJPRUbmQ4YzyS48lPmlJ-dFEo"
}
Using this api you can create/get products.
POST
/products
x-auth
None
{ "product":"some test product" }
String
{
"code": "success",
"error": false,
"message": "Successful",
"data": {
"productId": 10
}
GET
/products
x-auth
productId
none
String
{
"code": "success",
"error": false,
"message": "Successful",
"data": {
"products": [
{
"id": 4,
"product": "Farerro rocher cake",
"active": 1,
"created_at": "2022-10-08T17:49:28.000Z"
}
]
}
}
Using this api you can create/get platforms.
POST
/platforms
x-auth
None
{ "platform":"Instagram" }
String
{
"code": "success",
"error": false,
"message": "Successful",
"data": {
"platfromId": 5
}
}
GET
/platforms
x-auth
None
none
String
{
"code": "success",
"error": false,
"message": "Successful",
"data": {
"platforms": [
{
"id": 1,
"platform": "Google",
"active": 1,
"created_at": "2022-10-08T18:02:26.000Z"
},
{
"id": 2,
"platform": "Facebook",
"active": 1,
"created_at": "2022-10-08T18:03:57.000Z"
},
{
"id": 3,
"platform": "Youtube",
"active": 1,
"created_at": "2022-10-08T18:04:08.000Z"
},
{
"id": 4,
"platform": "Instagram",
"active": 1,
"created_at": "2022-10-08T18:04:18.000Z"
}
]
}
}
GET
/campaigns
x-auth
status='live&from=2022-10-04 23:32:26
none
String
{
"code": "success",
"error": false,
"message": "Successful",
"data": {
"campaigns": [
{
"id": 4,
"campaign_name": "testCampaign2",
"budget": 1000,
"status": "live",
"startDate": "2022-10-04T18:02:26.000Z",
"endDate": "2022-10-18T18:02:26.000Z",
"location": "delhi",
"plaform": "Youtube",
"product": "Brownie cake with cream",
"active": 1,
"created_at": "2022-10-09T09:16:24.000Z"
},
{
"id": 6,
"campaign_name": "testCampaign - 5",
"budget": 1000,
"status": "live",
"startDate": "2022-10-04T18:02:26.000Z",
"endDate": "2022-10-18T18:02:26.000Z",
"location": "delhi",
"plaform": "Facebook",
"product": "Blueberry cake",
"active": 1,
"created_at": "2022-10-09T09:16:38.000Z"
},
{
"id": 7,
"campaign_name": "testCampaign - 9",
"budget": 1000,
"status": "live",
"startDate": "2022-10-04T18:02:26.000Z",
"endDate": "2022-10-18T18:02:26.000Z",
"location": "delhi",
"plaform": "Facebook",
"product": "Blueberry cake",
"active": 0,
"created_at": "2022-10-09T15:52:16.000Z"
}
]
}
}
PUT
/campaigns
x-auth
campaignId=7
{ "active":0 }
String
{
"code": "success",
"error": false,
"message": "Successful",
"data": {
"updatedCampaign": [
{
"id": 7,
"campaign_name": "testCampaign - 9",
"budget": 1000,
"status": "live",
"startDate": "2022-10-04T18:02:26.000Z",
"endDate": "2022-10-18T18:02:26.000Z",
"location": "delhi",
"plaform": "Facebook",
"product": "Blueberry cake",
"active": 0,
"created_at": "2022-10-09T15:52:16.000Z"
}
]
}
}