# MAS ###### tags: `intelllex` ## Spotlights ### Get All Spotlights ``` GET /spotlights { "spotlights": [ { "index": number "spotlight_id": string "spotlight_title": string "spotlight_content": string "question_id": string "question_slug": string "section_id": string "section_slug": string } ] } ``` ## Wizard ### Get All Wizard Actions ``` GET /wizards/actions { "actions": [ { "action_id": "1", "action_name": "set up a SFO", "action_order": 1, "persona_id": "1", "persona_name": "Fund Manager", "persona_order": 1 } ] } ``` ### Get Wizard Action Related Questions ``` GET /wizards/actions/:id/questions?page=1&limit=3 { "questions": [ { "question_id": "", "question_slug": "", "question_title": "", "section_id": "", "section_slug": "", "question_summary": "", "index": 0, }, ... ], } ``` ## Get in Touch ``` POST /get_in_touch/email { "from_email": "noreply@intelllex.com", "from_user": "Intelllex", "to_email": "contact@intelllex.com", "to_user": "Intelllex", "subject": "Website - Enquiry Form", "content": "# Test title 2\n - test answer 1\n - test answer 2\n\n# Test answer\nis\nquite long", "content_type": "markdown" } curl -XPOST "https://masapi.intelllex.se/get_in_touch/email" -H "Content-type: application/json" -d '{"from_email": "contact@intelllex.com", "to_email": "chlin@intelllex.com", "subject": "test subject", "content": "# Test title 2\n - test answer 1\n - test answer 2\n\n# Test answer\nis\nquite long", "content_type": "markdown"}' ``` ## Partner ### List Partners ``` GET /partners?partner_ids[]=1&partner_ids[]=2&partner_ids[]=3 [ { "professional_type": "", "firm_size": "", "service_types": ["", ""], "jurisdictions": ["hk", "uk"], "description": "" "email": "zhengfeng@ferventchambers.com" "hashtags": ['personal data protection'] "id": "4" "name": "Fervent Chambers LLC" "photo": "44afac3b-9318-4579-b0dd-af34f49f7f3f" "photo_url": "https://cms.intelllex.com/assets/44afac3b-9318-4579-b0dd-af34f49f7f3f" "related-questions": [ { "hashtags": ['personal data protection'] "id": "558" "section_id": "managing-personal-data-pdpa-275" "section_title": "Managing personal data (PDPA)" "title": "Are companies, "slug": "are-we-responsible-if-our-employees-do-not-comply-with-the-pdpa-558" } ] ] ``` ### Get Partner By ID ``` GET /partners/[partner_id] { "professional_type": "", "firm_size": "", "service_types": ["", ""], "jurisdictions": ["hk", "uk"], "description": "" XXXXX } ``` ## Memo ### List Memo for the memo header sample: `https://masapi.intelllex.se/memos` > Control Image Size > See also: https://docs.directus.io/reference/files/#custom-transformations - memo_type: optional ``` GET /memos?memo_type=memo|business_primer|exploratory_reads [ { "id": "unique-string", "name": "Crypto regulation", "short_description": "This is a description of what this buiness essential topic is, will decide after memo is done.", "icon_url": "https://cms.intelllex.com/abc", "memo_type": "memo" or "business_primer", "label": "Hot Topic", "primer_title": "primer title", "primer_description": "primer description in HTML", "primer_image": "https://cms.intelllex.com/assets/39586970-e668-4fd5-808a-8ca19a0adf0b" }, { "id": "unique-string1", "name": "Because BVI", "short_description": "This is a description of what this buiness essential topic is, will decide after memo is done.", "icon_url": "https://cms.intelllex.com/abc", "memo_type": "memo" or "business_primer", "label": "Hot Topic", "primer_title": "primer title", "primer_description": "primer description in HTML", "primer_image": "https://cms.intelllex.com/assets/39586970-e668-4fd5-808a-8ca19a0adf0b" } ] ``` ### Memo Detail sample: `https://masapi.intelllex.se/memos/crypto-regs-102` ```bash curl -XGET "http://localhost:3000/memos/aiwm-knowledge-centre" ``` ``` GET /memos/[memo_id] { "id": "unique-string", "name": "Crypto regulation", "hero_image": { "desktop": "header photo url", "mobile": "header photo url", }, "description": "HTML of the description area e.g Cryptocurrencies in the British Virgin Islands (“BVI”) are regulated. Instead of a dedicated regime such as the Payment Services Act ", "preview_pdf": "https://cms.intelllex.com/first_page_pdf", "price": 200, "currency": "USD", "at_a_glance": "HTML of the AT A GLANCE section", "checkout_description": " html content", "checkout_preview_image": "url to preview image", "questions": [ // list of questions for the Q&As tab ], "memo_type": "memo" or "business_primer", "primer_pdf": "pdf url, user can download directly" "partner_ids": [7,8] "private": true | false } ``` ### Track Memo Download Email (call before user download primer pdf) ``` POST /memos/:memo_slug/track_download { "email": "felix@intelllex.com" } ``` ### Checkout redirect URL for the checkout button - **staging domain: `https://payment.intelllex.se`** - **prod domain: `https://payment.intelllex.com`** ``` Redirect to https://payment.intelllex.se/memo/checkout?cancel_url=https%3A%2F%2Fgoogle.com&memo_id=crypto-regs-102 ``` - memo_id: memo_id get from /memos API - cancel_url: redirect to this page if user cancel the payment ### Memo success page BE will redirect to FE page with the pdf URL in query e.g `https://finreg.sg/memo/[memo_id]/success?pdf_url=downloadable_pdf_url&expire_at=unix` ## Wiki ### Analyze A Wiki Docs Request ``` POST /wiki/docs/analyze { "feature_of_your_product": string } ``` Response: ``` { "feature_of_your_product": string "feature_of_your_product_hl": string } ``` ### Typing Prediction ``` POST /wiki/docs/predict { "text": string } ``` Response: ``` { "business_elements": [ { hashtag_type: string id: number name: string } ] } ``` ### Request A Wiki Doc ``` POST /wiki/docs { "feature_of_your_product": string "expand_to_singapore": boolean } ``` Response: ``` { "id": string "auth_code": string } ``` ### Request Auto Hashtag [Updates]: all the `match_type` options ``` match_type: "must_direct" match_type: "must_map" match_type: "optional_direct_sub" match_type: "optional_map" match_type: "optional" or "" ``` ``` GET /wiki/docs/[uuid]/auto_hashtags ``` Response: ``` { "auto_hashtags":[ { "id":123, "name":"DPT", "match_type":"must_direct", "order":"1", "selected":true }, { "id":234, "name":"DPT service", "match_type":"must_map", "order":"2", "selected":false }, { "id":234, "name":"DPT service", "match_type":"optional_map", "order":"3", "selected":true } ] } ``` ### Update Wiki ``` PUT /wiki/docs/[uuid] { "auth_code": string "email": string "deselected_question_ids_by_section": { [string]: string[] }, "auto_hashtags":[ { "id": number "name": string "match_type": match_type "order": string "selected": boolean } ] } ``` Response ``` { "id":"uuid" } ``` ### Wiki Docs Description ``` GET /wiki/docs/[uuid]/description ``` Response ``` { "feature_of_your_product": string "areas_of_your_business": string "feature_of_your_product_hl": string "areas_of_your_business_hl": string } ``` ### Get total questions count by doc id ``` GET /wiki/docs/[uuid]/questions/count 88 ``` ### Wiki Woc Section ``` GET /docs/[doc_uuid]/sections/[section_id] ``` Response: ``` { "id": number "name": string "finreg_business_tip": string "questions": [ { "id": string "title": string "last_revised_date": string "answers": [ { answer: string partner?: { id: number name: string photo_url: string hide_detail: boolean } } ], "finreg_business_tip": string } ] } ``` // 21-02-2022 ### Get sections by wiki docs (includes questions) #### list of section type: - payments_regulations - compliance - capital_markets_regulations - setting_up_in_singapore - business_features ``` GET /wiki/docs/[uuid]/sections?section_type=[section_type] [ { "id": number "name": string "section_type": section_type "questions":[ { "id": string "title": string } ] } ] ``` ### Wiki section's questions API ```https GET /wiki/sections/[section_id]/questions [ { "id": string "title": string "answer": string }, ] ``` // 21-02-2022 ### [NEW] Wiki section's questions API ```https NEED to know the doc_id to filter deselected_question_ids_by_section GET /wiki/docs/[doc_id]/sections/[section_id]/questions [ { "id": "5529", "title": "this is a question?", "answer": "answer in HTML", "partner_name": "" "partner_photo": "" }, { "id": "5530", "title": "this is a question 2?", "answer": "answer in HTML", "partner_name": "" "partner_photo": "" } ] ``` ### Wiki Docs Question Count ``` GET /wiki/docs/[doc_id]/questions/count { "count": 100 } ``` ### Wiki Doc Subscribe to get update API ```https POST /wiki/docs/[doc_id]/subscribe { "email": "abc@gmail.com", "notify_us": true // will notify LKE } ``` ## Sections ### Subscribe to get update API ```https POST /sections/[section_id]/subscribe { "email": "abc@gmail.com" } ``` ## Questions ### All ``` GET /questions/all?scope=[EA|Finreg|Ingenia]&popular=[true|false] { questions: [ { section_id(slug): string question_id: string lastmod: string image_url: string popular_order: int ( 0 -> n, 0 is default value) question_slug: string } ] } ``` ### Question Suggested Sections ``` GET /questions/[qid]/suggested-sections?history_qid[]=1&history_qid[]=2&history_qid[]=3 { "sections":[ { "slug": "nature-of-cryptocurrencies-280", "q_slug": "", "title": "Nature of Cryptocurrencies" }, { "slug": "nature-of-cryptocurrencies-280", "q_slug": "", "title": "Nature of Cryptocurrencies" } ] } ``` ### Search ``` GET /questions?q=crypto { "sections": [ { "section_id": "nature-of-cryptocurrencies-280", "section_type": "likely_regulated", "section_kind": "kind2", "section_kind_name": "Business overview", "section_title": "Nature of Cryptocurrencies", "jurisdictions": { "universal": [qid, ], "comparsion":[qid, ], "hk":[qid, ], "uk":[qid, ] }, "fbt": { "universal": "<fbt>", "comparsion": "<fbt>" ... }, "questions": [ { "question_id": "459", "hl_question_title": "Do <mark>cryptocurrencies</mark> fall under the scope of the Payment Services Act?", "question_title": "Do cryptocurrencies fall under the scope of the Payment Services Act?", "question_slug": "do-cryptocurrencies-fall-under-the-scope-of-the-payment-services-act-459" "is_expanded": true, "partner_infos": [], "jurisdictions": ["universal"], "fbt": "awesome fbt", "highlights": string[] }, { "question_id": "405", "hl_question_title": "Is <mark>cryptocurrency</mark> a property?", "question_title": "Is cryptocurrency a property?", "question_slug": "this-is-question-slug-405" "is_expanded": true, "partner_infos": [ { "id": 2, "name": "Rajah & Tann Singapore LLP" } ], "jurisdictions": ["hk", "uk"] "fbt": "", } ] } ] } ``` ### Definitions Search Query ``` GET /questions/definitions?query=userquery ``` Response: ``` { "title": "definition of dpt", "snippet": "dpt is the ...", "footnote": "according to mas...last revised", "question_id": "12", "question_slug": "this-is-questions-slug-12" "def_phrase": "digital payment token", "section_id": "nature-of-digital-payment-tokens-dpts-236", "jurisdictions": [{"name": "Singapore", "id": 555}, {"name": "Hong Kong", "id": 556}] } ``` - input - query: "XXXX dpt XXX nft" - process - match the "definition_entites" -> earendil from Chin-Ho - mock up: return map[keyword] - look up a dictionary and get the question definition related info -> mapping from Felix - definition entities and acronyms to question id mapping for definition detail looking up ```json { "question_definition_entity": "qid_1", "digital payment token": "323", . . . "question_definition_acronym": "qid_2", "dpt": "323" "nft": "123", . . . } ``` - a GET API such as `/questions/defintions/entities` - an API for syncing up definition entities and acronyms with earendil ```json { "acronyms": ["dpt", .....] "entities": ["digital payment tokens", ...] } ``` - wrap up into the response format and go the through the handler & routing part - question service - new file for the function - update service.go - route and handler - route.go - questions.go - output - title - snippet - jurisdiction - qid - .... - issues - multiple section - multiple match ### Auto fill Search Query ``` GET /questions/auto_fill?query=userquery ``` Response: ``` { "query_suggestions": [ { "type": "phrase" | "question", "section_id": <section_id>, "question_id": <question_id>, "name": "suggested_query1", "label": "<put_html_here>", "score": 0.7 } ] } ``` ### Last Updated On https://masapi.intelllex.se/questions/last_updated_on ``` GET /questions/last_updated_on { "last_updated_on": "2022-01-12T12:00:00Z" } ``` ### Get By ID ``` GET /questions/:id { "id": "474", "title": "What is Singapore's outlook on stablecoins?", "answer": "a", // DEPRECATED "last_revised_date": "", "image_url": "https://cms.intelllex.com/assets/1675c154-608e-4919-9fb4-137e9aeadea7", "answers": [ { "answer": "answer_html", "partner": { "id": 2, "name": "Rajah & Tann Singapore LLP", "photo_url": "", "hide_detail": true } } ], "articles": [ { "id": 22, "slug": "Navigating-the-Capital-Markets-Services-Licence-and-the-Financial-Adviser’s-Licence-22" "title": "Navigating the Capital Markets Services (CMS) Licence and the Financial Adviser’s Licence" } ] "finreg_business_tip": "" } ``` ### Get Summary of a Question ``` GET /questions/summary/:id { "id":"introduction-to-family-offices-629", "summary":"Family offices are private wealth management advisory firms that serve ultra-high-net-worth individuals. They offer a total outsourced solution to managing the financial and investment" } ``` ### Rate ``` POST /questions/:id/rate { "rate": 3 } ``` ## Documents ### Search e.g: `https://masapi.intelllex.se/documents?q=dpt&page=0&limit=10&order_by=relevance` ``` GET /documents?q=dpt&page=0&limit=10&order_by=relevance { "data": { "id": "1713503", "title": "Consultation on the Payment Services Act 2019: Proposed Amendments to the Act", "last_revised_date": "23 December 2019", "url": "https://www.mas.gov.sg/publications/consultations/2019/consultation-on-the-proposed-amendments-to-the-payment-services-act", "content_type": "Consultations", "source_type": "MAS", "tags": [ { "name": "payment services", "type": "sector" } ], "questions": [ { "id": "5200", "title": "As a custodian wallet service, must I hold a payment service provider licence?", "section_title": "Regulations for custodian wallets", "section_id": "regulations-for-custodian-wallets-271" } ], "highlights": [ "<mark>payment</mark> \n<mark>token</mark> (<mark>DPT</mark>) <mark>service</mark> (<mark>Activity</mark> <mark>F</mark>)." ] } } ``` # SOURCE ## Login ``` POST https://apiv2.intelllex.se/api/v1/login { company: string login: string password: string remember: "t" } ``` ## Resend welcome email POST https://apiv2.intelllex.se/api/v1/resend_welcome_email ``` { "email": "user@gmail.com" } ``` response: 200 ## Get portal URL GET https://apiv2.intelllex.se/api/v1/portal_api **Require Authorization: Bearer {token}** Response: ``` {"url":"https://billing.stripe.com/session/test_YWNjdF8xS2F5aGFCYTNiZmdZTG5nLF9MVk9BSkt1aHFxQ3FlVEk1ajQ4Z2VjQ2NZSndNU2Y00100n1ykhj9q"} ``` ## Get checkout URL POST https://apiv2.intelllex.se/api/v1/checkout_api **Require Authorization: Bearer {token}** ``` { "price_id": "price_source_monthly" } ``` Response: ``` {"url":"https://checkout.stripe.com/pay/cs_test_b1sik9I1k40k7mvfvwlEFLDezW1R7GAGFSuYvRHSO8IzlSnAZu2TXVDKze#fidkdWxOYHwnPyd1blpxYHZxWjA0TmR8bWRHZDZnY2JcSWtiRkAxdjFNSFxcalxLSmtIUnw2Nz11UmZdQ3dLTkdMdEdMVXFTbXZGMEpVdX10dk8zbGZxSGNUc1FoZkA1SFJjQEloVDFwZkBvNTVRVzNVa0hNSCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPydocGlxbFpscWBoJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgKSd1d2BpamRhQ2prcSc%2FJ0twa2xxaid4JSUl"} ``` ## SOURCE Register ``` POST https://apiv2.intelllex.se/api/v1/register/source { "email": "felix.vo+source@intelllex.com", "first_name": "Felix", "last_name": "Source", "profession": "Dev", "country_code": "sg", "receive_email": true } Response: { "status": "ok" } ``` ## Manage Subscription URL **require login** - staging: https://apiv2.intelllex.se/api/v1/portal - prod: https://apiv2.intelllex.com/api/v1/portal ``` GET /api/v1/portal { "url":"https://billing.stripe.com/session/test_YWNjdF8xS2F5aGFCYTNiZmdZTG5nLF9McEZUc21qSGJwNWF0YkdTd2VpUjdIVVJBNjVjVkxz0100E6L0ekN9" } ``` ## Checkout to payment URL **require login** - staging: https://apiv2.intelllex.se/api/v1/checkout - prod: https://apiv2.intelllex.com/api/v1/checkout - ``` POST /api/v1/checkout { "price_id": "price_id" } ``` Response: ``` { "url": "stripe's checkout URL" } ``` ## Added subscription fields to /user API staging: https://apiv2.intelllex.se/api/v1/user prod: https://apiv2.intelllex.com/api/v1/user - `current_period_end`: "2022-03-16T09:25:51.000Z" - `has_active_sub`: `true` or `false` calculated by comparing current time with `current_period_end` - `plan`: `trial` or `subscribed`, `trail` means in trial period e.g ``` { "user": { "id": "e6f20280-337f-40ae-b80d-1e993048c2f6", "company_id": "f05bf00c-d6f3-4443-895c-abb0b4be28da", "first_name": "Felix", "last_name": "Source", "email": "felix.vo+source4@intelllex.com", "created_at": "2022-03-23T01:44:16.490Z", "external_auth": false, "has_active_sub": true, "current_period_end": "2022-09-23T01:49:28.000Z", "plan": "subscribed", "rights": { "upload": false, "share": false, "admin": false }, "company_name": "source" } } ``` ## Articles ### All ``` GET /articles [ { "id": 1, "slug": "ar-slug-1", "name": "Nhan test", "category": "Common", "masthead": "https://cms.intelllex.com/assets/39d146c2-1da8-467a-ab6f-ad0b4ef15257", "content": "this is content" "date_published": "2023-03-17T19:00:00+07:00", "questions": [ { "id": 6055, "question": "What other alternatives are available for migrating to Singapore besides permanent residency (PR)?", "slug": "alternatives-for-migrating-to-singapore-besides-pr-6055" } ] } ] ``` ### Get By ID ``` GET /articles/:id { "id": 1, "slug": "ar-slug-1", "name": "Nhan test", "category": "Common", "masthead": "https://cms.intelllex.com/assets/39d146c2-1da8-467a-ab6f-ad0b4ef15257", "content": "this is content" "date_published": "2023-03-17T19:00:00+07:00", "questions": [ { "id": 6055, "question": "What other alternatives are available for migrating to Singapore besides permanent residency (PR)?", "slug": "alternatives-for-migrating-to-singapore-besides-pr-6055" } ] } ``` ## News ### All ``` GET /news [ { "id": 1, "slug": "new-slug-1", "name": "Nhan test news", "content": "This is content" "category": "common", "masthead": "https://cms.intelllex.com/assets/58f94839-79ce-4115-9b5c-489119326a46" "date_published": "2023-03-17T19:00:00+07:00" } ] ``` ### Get By ID ``` GET /news/:id { "id": 1, "slug": "new-slug-1", "name": "Nhan test news", "content": "this is content" "category": "common", "masthead": "https://cms.intelllex.com/assets/58f94839-79ce-4115-9b5c-489119326a46" "date_published": "2023-03-17T19:00:00+07:00" } ```