bcgov/nr-get-token

View on GitHub
app/frontend/public/files/ches.postman_collection.json

Summary

Maintainability
Test Coverage
{
    "info": {
        "_postman_id": "8ee4719e-a49f-4aee-b3cd-ad3e0dcc2073",
        "name": "Common Hosted Email Service",
        "description": "CHES - Powered by NodeMailer (a shared library)",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "item": [
        {
            "name": "v1",
            "item": [
                {
                    "name": "Health",
                    "item": [
                        {
                            "name": "/health",
                            "request": {
                                "method": "GET",
                                "header": [],
                                "url": {
                                    "raw": "http://ches.nrs.gov.bc.ca/api/v1/health",
                                    "protocol": "http",
                                    "host": [
                                        "ches",
                                        "nrs",
                                        "gov",
                                        "bc",
                                        "ca"
                                    ],
                                    "path": [
                                        "api",
                                        "v1",
                                        "health"
                                    ]
                                }
                            },
                            "response": []
                        }
                    ],
                    "protocolProfileBehavior": {},
                    "_postman_isSubFolder": true
                },
                {
                    "name": "Email",
                    "item": [
                        {
                            "name": "/email",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "name": "Content-Type",
                                        "value": "application/json",
                                        "type": "text"
                                    }
                                ],
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n  \"attachments\": [\n    {\n      \"content\": \"PGI+SGVsbG8gV29ybGRcITwvYj4=\",\n      \"contentType\": \"string\",\n      \"encoding\": \"base64\",\n      \"filename\": \"testfile.txt\"\n    }\n  ],\n  \"bcc\": [],\n  \"bodyType\": \"html\",\n  \"body\": \"Hello World content\",\n  \"cc\": [],\n  \"delayTS\": 1600000000000,\n  \"encoding\": \"utf-8\",\n  \"from\": \"emeil.here@gov.bc.ca\",\n  \"priority\": \"normal\",\n  \"subject\": \"Hello user\",\n  \"to\": [\n    \"emailhere@someemail.com\"\n  ],\n  \"tag\": \"tag\"\n}\n",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                },
                                "url": {
                                    "raw": "https://ches.nrs.gov.bc.ca/api/v1/email",
                                    "protocol": "https",
                                    "host": [
                                        "ches",
                                        "nrs",
                                        "gov",
                                        "bc",
                                        "ca"
                                    ],
                                    "path": [
                                        "api",
                                        "v1",
                                        "email"
                                    ],
                                    "query": [
                                        {
                                            "key": "devMode",
                                            "value": "true",
                                            "disabled": true
                                        }
                                    ]
                                }
                            },
                            "response": []
                        }
                    ],
                    "protocolProfileBehavior": {},
                    "_postman_isSubFolder": true
                },
                {
                    "name": "EmailMerge",
                    "item": [
                        {
                            "name": "/emailMerge",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "name": "Content-Type",
                                        "value": "application/json",
                                        "type": "text"
                                    }
                                ],
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"attachments\": [\n        {\n            \"content\": \"PGI+SGVsbG8gV29ybGRcITwvYj4=\",\n            \"contentType\": \"string\",\n            \"encoding\": \"base64\",\n            \"filename\": \"testfile.txt\"\n        }\n    ],\n    \"bodyType\": \"text\",\n    \"body\": \"Hello World {{ hello }} content\",\n    \"contexts\": [\n    \t{\n    \t\t\"to\": [\n\t\t        \"email@someemail.com\"\n\t\t    ],\n\t\t    \"context\": {\n\t\t    \t\"orange\": {\n\t\t            \"target\": \"jujaga\"\n\t\t        },\n\t\t        \"hello\": \"jujaga template\"\n\t\t    },\n\t\t    \"delayTS\": 1600000000000,\n\t\t    \"tag\": \"tag\"\n    \t},\n    \t{\n    \t\t\"to\": [\n\t\t        \"gkf63839@aklqo.com\"\n\t\t    ],\n\t\t    \"context\": {\n\t\t    \t\"orange\": {\n\t\t            \"target\": \"lucasoneil\"\n\t\t        },\n\t\t        \"hello\": \"lucas template\"\n\t\t    },\n\t\t    \"delayTS\": 1600000000000,\n\t\t    \"tag\": \"tag\"\n    \t}\n    ],\n    \"encoding\": \"utf-8\",\n    \"from\": \"email.here@gov.bc.ca\",\n    \"priority\": \"normal\",\n    \"subject\": \"Test {{ orange.target }}\"\n}"
                                },
                                "url": {
                                    "raw": "https://ches.nrs.gov.bc.ca/api/v1/emailMerge",
                                    "protocol": "https",
                                    "host": [
                                        "ches",
                                        "nrs",
                                        "gov",
                                        "bc",
                                        "ca"
                                    ],
                                    "path": [
                                        "api",
                                        "v1",
                                        "emailMerge"
                                    ],
                                    "query": [
                                        {
                                            "key": "devMode",
                                            "value": "true",
                                            "disabled": true
                                        }
                                    ]
                                }
                            },
                            "response": []
                        },
                        {
                            "name": "/emailMerge/preview",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "name": "Content-Type",
                                        "type": "text",
                                        "value": "application/json"
                                    }
                                ],
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"attachments\": [\n        {\n            \"content\": \"PGI+SGVsbG8gV29ybGRcITwvYj4=\",\n            \"contentType\": \"string\",\n            \"encoding\": \"base64\",\n            \"filename\": \"testfile.txt\"\n        }\n    ],\n    \"bodyType\": \"text\",\n    \"body\": \"Hello World {{ hello }} content\",\n    \"contexts\": [\n    \t{\n    \t\t\"to\": [\n\t\t        \"email@someemail.com\"\n\t\t    ],\n\t\t    \"context\": {\n\t\t    \t\"orange\": {\n\t\t            \"target\": \"jujaga\"\n\t\t        },\n\t\t        \"hello\": \"jujaga template\"\n\t\t    }\n    \t},\n    \t{\n    \t\t\"to\": [\n\t\t        \"gkf63839@aklqo.com\"\n\t\t    ],\n\t\t    \"context\": {\n\t\t    \t\"orange\": {\n\t\t            \"target\": \"lucasoneil\"\n\t\t        },\n\t\t        \"hello\": \"lucas template\"\n\t\t    },\n\t\t    \"delayTS\": 1579965760073,\n\t\t    \"tag\": \"tag\"\n    \t}\n    ],\n    \"encoding\": \"utf-8\",\n    \"from\": \"some.email@gov.bc.ca\",\n    \"priority\": \"normal\",\n    \"subject\": \"Test {{ orange.target }}\"\n}"
                                },
                                "url": {
                                    "raw": "https://ches.nrs.gov.bc.ca/api/v1/emailMerge/preview",
                                    "protocol": "https",
                                    "host": [
                                        "ches",
                                        "nrs",
                                        "gov",
                                        "bc",
                                        "ca"
                                    ],
                                    "path": [
                                        "api",
                                        "v1",
                                        "emailMerge",
                                        "preview"
                                    ]
                                }
                            },
                            "response": []
                        }
                    ],
                    "protocolProfileBehavior": {},
                    "_postman_isSubFolder": true
                },
                {
                    "name": "Message",
                    "item": [
                        {
                            "name": "/status",
                            "request": {
                                "method": "GET",
                                "header": [],
                                "url": {
                                    "raw": "https://ches.nrs.gov.bc.ca/api/v1/status?msgId=58550335-b0f8-417f-aaca-a79fcb407353",
                                    "protocol": "https",
                                    "host": [
                                        "ches",
                                        "nrs",
                                        "gov",
                                        "bc",
                                        "ca"
                                    ],
                                    "path": [
                                        "api",
                                        "v1",
                                        "status"
                                    ],
                                    "query": [
                                        {
                                            "key": "msgId",
                                            "value": "7ebbbdad-0671-44aa-91d9-36151308df73",
                                            "disabled": true
                                        },
                                        {
                                            "key": "status",
                                            "value": "completed",
                                            "disabled": true
                                        },
                                        {
                                            "key": "tag",
                                            "value": "tag",
                                            "disabled": true
                                        },
                                        {
                                            "key": "msgId",
                                            "value": "58550335-b0f8-417f-aaca-a79fcb407353"
                                        }
                                    ]
                                }
                            },
                            "response": []
                        },
                        {
                            "name": "/status/:msgId",
                            "request": {
                                "method": "GET",
                                "header": [],
                                "url": {
                                    "raw": "http://ches.nrs.gov.bc.ca/api/v1/status/:msgId",
                                    "protocol": "http",
                                    "host": [
                                        "ches",
                                        "nrs",
                                        "gov",
                                        "bc",
                                        "ca"
                                    ],
                                    "path": [
                                        "api",
                                        "v1",
                                        "status",
                                        ":msgId"
                                    ],
                                    "variable": [
                                        {
                                            "key": "msgId",
                                            "value": "58550335-b0f8-417f-aaca-a79fcb407353"
                                        }
                                    ]
                                }
                            },
                            "response": []
                        },
                        {
                            "name": "/cancel",
                            "request": {
                                "method": "DELETE",
                                "header": [],
                                "url": {
                                    "raw": "https://ches.nrs.gov.bc.ca/api/v1/cancel?txId=679e02e8-66ca-4859-8dfb-d8eed3c8d16a",
                                    "protocol": "https",
                                    "host": [
                                        "ches",
                                        "nrs",
                                        "gov",
                                        "bc",
                                        "ca"
                                    ],
                                    "path": [
                                        "api",
                                        "v1",
                                        "cancel"
                                    ],
                                    "query": [
                                        {
                                            "key": "msgId",
                                            "value": "dd42b60e-d420-4fdb-95fa-e31dd78479eb",
                                            "disabled": true
                                        },
                                        {
                                            "key": "status",
                                            "value": "completed",
                                            "disabled": true
                                        },
                                        {
                                            "key": "tag",
                                            "value": "tag",
                                            "disabled": true
                                        },
                                        {
                                            "key": "txId",
                                            "value": "679e02e8-66ca-4859-8dfb-d8eed3c8d16a"
                                        }
                                    ]
                                }
                            },
                            "response": []
                        },
                        {
                            "name": "/cancel/:msgId",
                            "request": {
                                "method": "DELETE",
                                "header": [],
                                "url": {
                                    "raw": "https://ches.nrs.gov.bc.ca/api/v1/cancel/:msgId",
                                    "protocol": "https",
                                    "host": [
                                        "ches",
                                        "nrs",
                                        "gov",
                                        "bc",
                                        "ca"
                                    ],
                                    "path": [
                                        "api",
                                        "v1",
                                        "cancel",
                                        ":msgId"
                                    ],
                                    "variable": [
                                        {
                                            "key": "msgId",
                                            "value": "f550459b-8c5a-47b6-8789-fc9f30e31583"
                                        }
                                    ]
                                }
                            },
                            "response": []
                        }
                    ],
                    "protocolProfileBehavior": {},
                    "_postman_isSubFolder": true
                }
            ],
            "protocolProfileBehavior": {}
        },
        {
            "name": "Request a Token",
            "request": {
                "auth": {
                    "type": "basic",
                    "basic": [
                        {
                            "key": "password",
                            "value": "[PASTE YOUR PASSWORD HERE]",
                            "type": "string"
                        },
                        {
                            "key": "username",
                            "value": "[PASTE YOUR SERVICE CLIENT HERE]",
                            "type": "string"
                        }
                    ]
                },
                "method": "POST",
                "header": [
                    {
                        "key": "Content-Type",
                        "name": "Content-Type",
                        "type": "text",
                        "value": "application/x-www-form-urlencoded"
                    }
                ],
                "body": {
                    "mode": "urlencoded",
                    "urlencoded": [
                        {
                            "key": "grant_type",
                            "value": "client_credentials",
                            "type": "text"
                        }
                    ]
                },
                "url": {
                    "raw": "https://oidc.gov.bc.ca/auth/realms/jbd6rnxw/protocol/openid-connect/token",
                    "protocol": "https",
                    "host": [
                        "oidc",
                        "gov",
                        "bc",
                        "ca"
                    ],
                    "path": [
                        "auth",
                        "realms",
                        "jbd6rnxw",
                        "protocol",
                        "openid-connect",
                        "token"
                    ]
                },
                "description": "This request will get an OAuth Access Token that is required for calls to the Common Services API's.\n\nThe reponse from this request (the Access Token) can be attached to the top level 'Common Services' collection and then 'Inherited from parent' by the requests contained inside it."
            },
            "response": []
        }
    ],
    "auth": {
        "type": "oauth2",
        "oauth2": [
            {
                "key": "accessToken",
                "value": "",
                "type": "string"
            },
            {
                "key": "tokenType",
                "value": "bearer",
                "type": "string"
            },
            {
                "key": "addTokenTo",
                "value": "header",
                "type": "string"
            }
        ]
    },
    "event": [
        {
            "listen": "prerequest",
            "script": {
                "id": "bb34c51f-e8ea-46c6-a668-912ceee0cf7e",
                "type": "text/javascript",
                "exec": [
                    ""
                ]
            }
        },
        {
            "listen": "test",
            "script": {
                "id": "a6779470-abd0-4b5e-a5e3-0f3dd9e957a7",
                "type": "text/javascript",
                "exec": [
                    ""
                ]
            }
        }
    ],
    "protocolProfileBehavior": {}
}