Skip to content

Instantly share code, notes, and snippets.

@ahmadrosid
Last active December 9, 2019 10:07
Show Gist options
  • Save ahmadrosid/98961313f4063ab8186366227f168096 to your computer and use it in GitHub Desktop.
Save ahmadrosid/98961313f4063ab8186366227f168096 to your computer and use it in GitHub Desktop.

Create Site :

curl -X POST \
  https://dev-kong.command-api.kw.com/mns/sites \
  -H 'Authorization: Bearer {{token_here}}' \
  -H 'Content-Type: application/json' \
  -d '{
    "data": {
        "attributes": {
            "type": "agent",
            "kw_uid": null,
            "org_id": 206,
            "config": {
                "theme": {
                    "theme_color": "red",
                    "header_text": "Header",
                    "header_sub_text": "Header sub text",
                    "search_header_text": "Search header text",
                    "hero_images": [
                        "https://dummyimage.com/600x400/000/fff"
                    ]
                },
                "analytics": {
                    "facebook_pixel_id": "facebook_pixel_id",
                    "google_analytics_tracking_id": "google_analytics_tracking_id",
                    "google_analytics_account_id": "google_analytics_account_id"
                },
                "seo": {
                    "seo_description": "seo_description",
                    "seo_keywords": [
                        "seo_keyword",
                        "seo_keyword_2"
                    ]
                }
            },
            "profile": {
                "type": "bc",
                "type_id": "4",
                "profile": {
                    "profile": {
                        "first_name": "Raline Shah",
                        "last_name": "Jelita",
                        "email": "[email protected]",
                        "designation": "",
                        "agent_photo": "https://storage.googleapis.com/attachment-prod-e2ad/bn74fec3a98vupp2cab0",
                        "agent_bio": "Cantik jelita itulah aku",
                        "agent_license": "123456789",
                        "marketing_title": "Model",
                        "brokerage_license": "License-12345678",
                        "brokerage_phone": "081212345678",
                        "legal_footer": "My legal footer",
                        "mobile_phone": "085612345678",
                        "office_phone": "081212345678",
                        "fax": "",
                        "website": "https://www.instagram.com/ralineshah",
                        "team": "Sampo Pantene",
                        "branding_enabled": false,
                        "market_center": {
                            "market_center_name": "Pantene Group",
                            "market_center_address1": "Jakarta",
                            "market_center_address2": "Jakarta"
                        }
                    },
                    "social": {
                        "facebook": "",
                        "linkedin": "",
                        "instagram": "https://www.instagram.com/ralineshah",
                        "youtube": "",
                        "twitter": "",
                        "app_link": ""
                    },
                    "logo": {
                        "team_logo": "https://storage.googleapis.com/attachment-prod-e2ad/bn74ga5ua44bvpooi880",
                        "dba_logo": "https://storage.googleapis.com/attachment-prod-e2ad/bn74ha43a98vupp2cac0",
                        "hero_image": [
                            "https://storage.googleapis.com/attachment-listing-prod-5af4/getty-images/bm0ggmfj4s4cpc27f440.jpg",
                            "https://storage.googleapis.com/attachment-listing-prod-5af4/getty-images/bm0ggs7j4s4cpc27f45g.jpg",
                            "https://storage.googleapis.com/attachment-listing-prod-5af4/getty-images/bm0gh1hs2gb8nfae7670.jpg",
                            "https://storage.googleapis.com/attachment-listing-prod-5af4/getty-images/bm0gh5ps2gb8nfae768g.jpg",
                            "https://storage.googleapis.com/attachment-listing-prod-5af4/getty-images/bm0ghafj4s4cpc27f490.jpg"
                        ]
                    },
                    "analytics": {
                        "facebook_pixel_id": "",
                        "google_analytics_id": ""
                    },
                    "agent_site": {
                        "footer": null
                    }
                }
            }
        }
    }
}'

Update sites :

curl -X PATCH \
  https://dev-kong.command-api.kw.com/mns/sites/ee374bde-15fe-44f1-a949-f81d485bb97b \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Bearer {{token_here}}' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: 4121' \
  -H 'Content-Type: application/json' \
  -H 'Host: dev-kong.command-api.kw.com' \
  -H 'Postman-Token: 29accf6e-76fb-4363-aa53-fb5eb892ed19,ee1e7ec1-5b5d-47f0-a6a1-baebbcf66f4e' \
  -H 'User-Agent: PostmanRuntime/7.20.1' \
  -H 'cache-control: no-cache' \
  -d '{
    "data": {
        "attributes": {
            "type": "agent",
            "kw_uid": null,
            "org_id": 206,
            "config": {
                "theme": {
                    "theme_color": "red",
                    "header_text": "Header update here",
                    "header_sub_text": "Header sub text",
                    "search_header_text": "Search header text",
                    "hero_images": [
                        "https://dummyimage.com/600x400/000/fff"
                    ]
                },
                "analytics": {
                    "facebook_pixel_id": "facebook_pixel_id",
                    "google_analytics_tracking_id": "google_analytics_tracking_id",
                    "google_analytics_account_id": "google_analytics_account_id"
                },
                "seo": {
                    "seo_description": "seo_description",
                    "seo_keywords": [
                        "seo_keyword",
                        "seo_keyword_2"
                    ]
                }
            },
            "profile": {
                "type": "bc",
                "type_id": "4",
                "profile": {
                    "profile": {
                        "first_name": "Raline Shah",
                        "last_name": "Jelita",
                        "email": "[email protected]",
                        "designation": "",
                        "agent_photo": "https://storage.googleapis.com/attachment-prod-e2ad/bn74fec3a98vupp2cab0",
                        "agent_bio": "Cantik jelita itulah aku",
                        "agent_license": "123456789",
                        "marketing_title": "Model",
                        "brokerage_license": "License-12345678",
                        "brokerage_phone": "081212345678",
                        "legal_footer": "My legal footer",
                        "mobile_phone": "085612345678",
                        "office_phone": "081212345678",
                        "fax": "",
                        "website": "https://www.instagram.com/ralineshah",
                        "team": "Sampo Pantene",
                        "branding_enabled": false,
                        "market_center": {
                            "market_center_name": "Pantene Group",
                            "market_center_address1": "Jakarta",
                            "market_center_address2": "Jakarta"
                        }
                    },
                    "social": {
                        "facebook": "",
                        "linkedin": "",
                        "instagram": "https://www.instagram.com/ralineshah",
                        "youtube": "",
                        "twitter": "",
                        "app_link": ""
                    },
                    "logo": {
                        "team_logo": "https://storage.googleapis.com/attachment-prod-e2ad/bn74ga5ua44bvpooi880",
                        "dba_logo": "https://storage.googleapis.com/attachment-prod-e2ad/bn74ha43a98vupp2cac0",
                        "hero_image": [
                            "https://storage.googleapis.com/attachment-listing-prod-5af4/getty-images/bm0ggmfj4s4cpc27f440.jpg",
                            "https://storage.googleapis.com/attachment-listing-prod-5af4/getty-images/bm0ggs7j4s4cpc27f45g.jpg",
                            "https://storage.googleapis.com/attachment-listing-prod-5af4/getty-images/bm0gh1hs2gb8nfae7670.jpg",
                            "https://storage.googleapis.com/attachment-listing-prod-5af4/getty-images/bm0gh5ps2gb8nfae768g.jpg",
                            "https://storage.googleapis.com/attachment-listing-prod-5af4/getty-images/bm0ghafj4s4cpc27f490.jpg"
                        ]
                    },
                    "analytics": {
                        "facebook_pixel_id": "",
                        "google_analytics_id": ""
                    },
                    "agent_site": {
                        "footer": null
                    }
                }
            }
        }
    }
}'

Delete site :

curl -X DELETE \
  https://dev-kong.command-api.kw.com/mns/sites/{{siteId}} \
  -H 'Authorization: Bearer {{token_here}}'  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment