{"openapi":"3.0.0","info":{"description":"","version":"1.0.0","title":"A2P API","contact":{"email":"example@example.com"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"tags":[{"name":"RESOURCES","description":"APIs Supported"}],"paths":{"/auth":{"post":{"tags":["RESOURCES"],"summary":"Validate key and secret provided on the database.","responses":{"200":{"description":"Successful Login","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"},"example":{"code":200,"message":"Login successful","token_type":"bearer","access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiZTg4NDNlZTctZDI1Zi00ZjIyLWI1MzEtZWZmN2NmNzk4N2M5IiwidHlwZSI6ImF1dGhvcml6YXRpb25fY29kZSIsInNlc3Npb25faWQiOiI5ODdlNTZjMC1kODA1LTQ0ZGMtOWU5My0xNzg2N2IzNWVjZWQiLCJzY29wZSI6WyJyZXBvcnRzIiwiYWRtaW4iXSwibmJmIjoxNjIwMTg3NTUwLCJpYXQiOjE2MjAxODc1NTAsImV4cCI6MTYyMDE4ODQ1MH0.4QuYgmZ4f3ZTZl-AdZdIy5dpPpV9sm66VCgLu2lJoN4"}}}},"401":{"description":"Invalid Core Credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response401005"},"example":{"code":401005,"message":"Invalid Core Credentials"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthRequest"},"example":{"key":"bRGiCCz18ypwTPgKjC","secret":"MLL2dy0Wdny7c4NcjpSUNLlyZPXsxFEDqWl4tKyuKnvYlugXDVgjgKx45BnOt2CsT52CtfIlltWMJZq4YR6yo514"}}}}}},"/cohort-code-list":{"get":{"tags":["RESOURCES"],"summary":"Display list of cohort code","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CohortCodeListResponse"},"example":{"code":200,"message":"Success","data":[{"cohort_category":"demographic","cohort_code":"bpo_workers","cohort_description":"People who are BPO workers"},{"cohort_category":"demographic","cohort_code":"female","cohort_description":"People who are female"},{"cohort_category":"demographic","cohort_code":"grab_drivers","cohort_description":"People who are grab drivers"},{"cohort_category":"demographic","cohort_code":"male","cohort_description":"People who are male"},{"cohort_category":"purchase_intent","cohort_code":"software","cohort_description":"People who are likely to buy software products"},{"cohort_category":"interest","cohort_code":"software","cohort_description":"People who are interested to buy software products"},{"cohort_category":"demographic","cohort_code":"young_adult","cohort_description":"People who are 20 to 29 years old"}]}}}}},"parameters":[{"in":"header","name":"Authorization","required":false,"description":"Bearer token generated after authentication","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uX2lkIjoiYjJlMmNjMzQtYTc5Ni00MTdkLWI2MmQtYTJkZThjNzBhYmFjIiwidGVuYW50X2lkIjoiOTNjNzc1ZWItYjQyZi00ZmQ2LWE5OWMtZjc1MTQ5YTcxZWQ1IiwiaWF0IjoxNjIwMzYyMjMzLCJleHAiOjE2MjAzNjU4MzN9.S7lN5o5I6j2JTq3hXz905hFgr_9lf80ZfPBYPZx1qAs","schema":{"type":"string"}}]}},"/generate-audience":{"post":{"tags":["RESOURCES"],"summary":"Generating audience mobile number.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAudienceResponse"},"example":{"code":200,"message":"Success"}}}},"422":{"description":"Invalid parameter requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response422"},"example":{"code":422,"message":"Parameter error: Please provide required parameter","errors":{"cohort_type":"cohort_type must be one of [match_all, match_any]","cohort_code":[{"category":"cohort_code[0].category must be one of [demographic, purchase_intent, interest]"}]}}}}}},"parameters":[{"in":"header","name":"Authorization","required":false,"description":"Bearer token generated after authentication","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uX2lkIjoiYjJlMmNjMzQtYTc5Ni00MTdkLWI2MmQtYTJkZThjNzBhYmFjIiwidGVuYW50X2lkIjoiOTNjNzc1ZWItYjQyZi00ZmQ2LWE5OWMtZjc1MTQ5YTcxZWQ1IiwiaWF0IjoxNjIwMzYyMjMzLCJleHAiOjE2MjAzNjU4MzN9.S7lN5o5I6j2JTq3hXz905hFgr_9lf80ZfPBYPZx1qAs","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAudienceRequest"},"example":{"callback_url":"<Clients callback URL>","cohort_type":"match_any","cohort_code":[{"category":"demographic","code":["female","young_adult"]},{"category":"purchase_intent","code":["software"]},{"category":"interest","code":["software"]}]}}}}}}},"components":{"schemas":{"AuthenticationToken":{"type":"string","description":"JWT Token to access secured apis"},"RefreshToken":{"type":"string","description":"Token to regenerate the AuthenticationToken"},"Response400":{"description":"Bad Request","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}},"Response401":{"description":"Invalid access details provided","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}},"Response403":{"description":"Missing access token or account was blocked","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}},"Response404":{"description":"Entity not found","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}},"Response409":{"description":"Account already existed","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}},"Response410":{"description":"OTP Expired","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}},"Response419":{"description":"Token expired","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}},"Response422":{"description":"Incomplete parameter provided","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"},"errors":{"type":"object","properties":{"<fieldname>":{"type":"string","description":"Error about the field"}}}}},"Response423":{"description":"Max tries reached","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}},"Response401005":{"description":"Invalid Core Credentials","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}},"SuccessResponse":{"description":"Success Response","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}},"AuthRequest":{"description":"","type":"object","properties":{"key":{"type":"string","description":"Session key"},"secret":{"type":"string","description":"Session secret"}}},"AuthResponse":{"description":"","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"},"token_type":{"type":"string","description":"Token type"},"token":{"type":"string","description":"Access token"}}},"CohortCodeListResponse":{"description":"","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"},"data":{"type":"string","description":"List of cohort codes","properties":{"cohort_category":{"type":"string","description":"Cohort code caegory"},"cohort_code":{"type":"string","description":"Cohort code"},"cohort_description":{"type":"string","description":"Cohort code description"}}}}},"GenerateAudienceRequest":{"description":"","type":"object","properties":{"callback_url":{"type":"string","description":"Clients callback URL."},"cohort_type":{"type":"string","description":"Cohort Type [match_any, match_all]"},"cohort_code":{"type":"array","description":"Cohort Codes","items":{"type":"object","properties":{"category":{"type":"string","description":"Cohort Code Category."},"code":{"type":"string","description":"Pre-define cohort code."}}}}}},"GenerateAudienceResponse":{"description":"","type":"object","properties":{"endpoint":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}}}}}