SysAd API Documentation

Login

GET /api/lgn/me

Description: Get credential, if credential is verified, return is array of available companies

Headers:
{
  "user": "login_username",
  "pass": "login_password",
}

user : login username
pass : user password

Response:
{
  "code": int,
  "success": boolean,
  "message": "string",
  "result": [{},{},...]
}

result is an array of objects representing company information. The data returned is conditional on the user’s access permissions, and may be empty if no authorized records are available

GET /api/lgn/entity

Description: Get entity by company id. The company id is get from /api/lgn/me

Headers:
{
  "user": "login_username",
  "id": "company_id",
}

user : login username
id : company id, get from /api/lgn/me. This id would never changed.

Response:
{
  "code": int,
  "success": boolean,
  "message": "string",
  "result": [{},{},...]
}

result is an array of objects contain entities in company selected.

GET /api/lgn/year

Description: Get the list of database year by entity

Headers:
{
  "user": "login_username",
  "comp": "company_id",
  "ent": "entity_id",
}

user : login username
comp : company id, get from /api/lgn/me. This id would never changed.
ent : Entity id, get from /api/lgn/entity. This id would never changed.

Response:
{
  "code": int,
  "success": boolean,
  "message": "string",
  "result": [int,int,...]
}

The result property contains an array of integers, each representing a year for which company data is available within the entity selected.

GET /api/lgn/token

Description: Generate token for API transactions

Headers:
{
  "user": "login_username",
  "pass": "login_password",
  "comp": "company_id",
  "ent" : "entity_id"
  "year" : int
}

user : login username
pass : user password
comp : company id, get from /api/lgn/me. This id would never changed.
ent : Entity id, get from /api/lgn/entity. This id would never changed.
year : year of database

Response:
{
  "code": int,
  "success": boolean,
  "message": "string",
  "result": "token_string"
}

result is a string that holds the generated access token. The token serves as a credential for the client to access protected resources, and its validity depends on the authentication context.

Media - Plan

GET /api/mda/getplan

Description: Get media plan.

Headers: token

{
  token: "your_token"
}

Request Body:
[{
  from: "yyyy-MM-dd",
  to: "yyyy-MM-dd",
  cust_id: ["string",...],
  product_id: ["string",...],
  po_id: ["string",...],
  budget_id: ["string",...]
}]

from: begin date of media plan, format "yyyy-MM-dd", all years if undefined
to: end date of media plan, format "yyyy-MM-dd", all years if undefined
cust_id: array of string - id client campaign, all clients if undefined
product_id: array of string - id product campaign, all product if undefined
po_id: array of string - po client id, all po_id if undefined
budget_id: array of string - search all plan by budget id, all if undefined

Response:
[{
    "code": int,
    "success": boolean,
    "message": "string",
    "result": [{},{},...]
}]
POST /api/mda/approveplan

Description: Approve media plan.

Headers: token

Request Body:
[
  { plan_id: "plan_number", app_by: "approver_name" },...
]

plan_id: string - plan number with format MASTER_PLAN#/MEDIA_TYPE.GROUP_# ex: AAA.260001/T.01
app_by: string - the name of approver

Response:
{
    "code": int,
    "success": boolean,
    "message": "string",
    "result": [{},{},...]
}

Finance - Account Receivable

GET /api/ar/get

Description: Get invoice

Headers: token

Request Body:
[{
  cust_id: ["string",...],
  product_id: ["string",...],
  inv_id: ["string",...]
}]

cust_id: array of string - id clients, all clients if undefined
product_id: array of string - id products, all products if undefined
inv_id: array of string - invoice numbers, all invoice numbers if undefined

Response:
{
  "code": int,
  "success": boolean,
  "message": "string",
  "result": [{},{},...]
}

Master - Vendor

GET /api/mst/getvendor

Description: Get vendor data

Headers: token

Request Body:
[
  { vendor_id: ["string",...] }
]

vendor_id: array of string - id vendor, all vendor if undefined

Response:
{
  "code": int,
  "success": boolean,
  "message": "string",
  "result": [{},{},...]
}

Master - Client

GET /api/mst/getclient

Description: Get client data

Headers: token

Request Body:
[
  { cust_id: ["string",...] }
]

cust_id: array of string - id clients, all clients if undefined

Response:
{
  "code": int,
  "success": boolean,
  "message": "string",
  "result": [{},{},...]
}

Master - Product

GET /api/mst/getproduct

Description: Get product data

Headers: token

Request Body:
[
  { cust_id: ["string",...] },
  { product_id: ["string",...] }
]

cust_id: array of string - id clients, all clients if undefined
product_id: array of string - id products, all products if undefined

Response:
{
  "code": int,
  "success": boolean,
  "message": "string",
  "result": [{},{},...]
}

Master - Budget

GET /api/mst/getbudget

Description: Get budget data

Headers: token

Request Body:
[
  { cust_id: ["string",...] },
  { product_id: ["string",...] },
  { budget_id: ["string",...] },
  { po_id: ["string",...] }
]

cust_id: array of string - id clients, all clients if undefined
product_id: array of string - id products, all products if undefined
budget_id: array of string - budget number, all budget if undefined
po_id: array of string - po client id, all po if undefined

Response:
{
  "code": int,
  "success": boolean,
  "message": "string",
  "result": [{},{},...]
}
POST /api/mst/createbudget

Description: Create budget

Headers: token

Request Body:
[{
  po_id: "string",
  product_id: "string",
  period: "string",
  value: 0,
  desc: "",
  media: "MT",
  type: "O",
}]

po_id : po client number
product_id : id product at sysad
period : period campaign "yyyy-MM-dd"
value : po value
desc : budget description
media : media placement (MT/MP/MR/MC/MD/MO)
type : "O/F/C/I" => O = original budget, F = forecast, C = CPRP, I = internal, default value = O

Response:
{
  "code": int,
  "success": boolean,
  "message": "string",
  "result": [{}]
}

Master - Employee

GET /api/mst/getemployee

Description: Get employee data

Headers: token

Request Body:
[
  { emp_id: ["string",...] }
]

emp_id: array of string - id employee, all employees if undefined

Response:
{
  "code": int,
  "success": boolean,
  "message": "string",
  "result": [{},{},...]
}
Copied to clipboard ✓