|
1 | 1 | { |
2 | 2 | "info": { |
3 | 3 | "_postman_id": "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", |
4 | | - "name": "Github", |
| 4 | + "name": "Example-Postman", |
5 | 5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", |
6 | 6 | "_exporter_id": "XXXXXXXX" |
7 | 7 | }, |
|
1446 | 1446 | "name": "Domestic Labels", |
1447 | 1447 | "item": [ |
1448 | 1448 | { |
1449 | | - "name": "Priority Mail - Single Piece (SP) - Non-Machinable", |
| 1449 | + "name": "2.0 Domestic Label", |
1450 | 1450 | "event": [ |
1451 | 1451 | { |
1452 | 1452 | "listen": "test", |
|
1546 | 1546 | } |
1547 | 1547 | }, |
1548 | 1548 | "response": [] |
| 1549 | + }, |
| 1550 | + { |
| 1551 | + "name": "3.0 Domestic Label", |
| 1552 | + "event": [ |
| 1553 | + { |
| 1554 | + "listen": "test", |
| 1555 | + "script": { |
| 1556 | + "exec": [ |
| 1557 | + "pm.test(\"Status code is 200\", function () {\r", |
| 1558 | + " pm.response.to.have.status(200);\r", |
| 1559 | + "});\r", |
| 1560 | + "\r", |
| 1561 | + "const responseCollection= pm.response.text().split(\"\\n\");\r", |
| 1562 | + "const labelImageData = responseCollection[10]\r", |
| 1563 | + "const labelType = responseCollection[6].split(\" \")[1]\r", |
| 1564 | + "let template = `data:${labelType};base64,${labelImageData}`\r", |
| 1565 | + "//let template = `data:application/octet-stream;base64, ${labelImageData}`\r", |
| 1566 | + "pm.visualizer.set(template)" |
| 1567 | + ], |
| 1568 | + "type": "text/javascript" |
| 1569 | + } |
| 1570 | + } |
| 1571 | + ], |
| 1572 | + "request": { |
| 1573 | + "auth": { |
| 1574 | + "type": "oauth2", |
| 1575 | + "oauth2": [ |
| 1576 | + { |
| 1577 | + "key": "accessTokenUrl", |
| 1578 | + "value": "", |
| 1579 | + "type": "string" |
| 1580 | + }, |
| 1581 | + { |
| 1582 | + "key": "clientSecret", |
| 1583 | + "value": "", |
| 1584 | + "type": "string" |
| 1585 | + }, |
| 1586 | + { |
| 1587 | + "key": "clientId", |
| 1588 | + "value": "", |
| 1589 | + "type": "string" |
| 1590 | + }, |
| 1591 | + { |
| 1592 | + "key": "tokenType", |
| 1593 | + "value": "", |
| 1594 | + "type": "string" |
| 1595 | + }, |
| 1596 | + { |
| 1597 | + "key": "accessToken", |
| 1598 | + "value": "{{token}}", |
| 1599 | + "type": "string" |
| 1600 | + }, |
| 1601 | + { |
| 1602 | + "key": "client_authentication", |
| 1603 | + "value": "body", |
| 1604 | + "type": "string" |
| 1605 | + }, |
| 1606 | + { |
| 1607 | + "key": "grant_type", |
| 1608 | + "value": "client_credentials", |
| 1609 | + "type": "string" |
| 1610 | + }, |
| 1611 | + { |
| 1612 | + "key": "addTokenTo", |
| 1613 | + "value": "header", |
| 1614 | + "type": "string" |
| 1615 | + } |
| 1616 | + ] |
| 1617 | + }, |
| 1618 | + "method": "POST", |
| 1619 | + "header": [ |
| 1620 | + { |
| 1621 | + "key": "X-Payment-Authorization-Token", |
| 1622 | + "value": "", |
| 1623 | + "type": "text" |
| 1624 | + } |
| 1625 | + ], |
| 1626 | + "body": { |
| 1627 | + "mode": "raw", |
| 1628 | + "raw": "{\r\n \"imageInfo\": {\r\n \"imageType\": \"PDF\",\r\n \"labelType\": \"4X6LABEL\",\r\n \"shipInfo\": true,\r\n \"receiptOption\": \"NONE\",\r\n \"suppressPostage\": false,\r\n \"suppressMailDate\": false,\r\n \"returnLabel\": false\r\n },\r\n \"toAddress\": {\r\n \"firstName\": \"Joe\",\r\n \"lastName\": \"Doe\",\r\n \"streetAddress\": \"1100 Wyoming\",\r\n \"secondaryAddress\": \"Suite 150\",\r\n \"city\": \"St. Louis\",\r\n \"state\": \"MO\",\r\n \"ZIPCode\": \"63118\"\r\n },\r\n \"fromAddress\": {\r\n \"firstName\": \"John\",\r\n \"lastName\": \"Smith\",\r\n \"streetAddress\": \"4120 Bingham\",\r\n \"city\": \"St. Louis\",\r\n \"state\": \"MO\",\r\n \"ZIPCode\": \"63116\"\r\n },\r\n \"packageDescription\": {\r\n \"mailClass\": \"PRIORITY_MAIL\",\r\n \"rateIndicator\": \"SP\",\r\n \"weightUOM\": \"lb\",\r\n \"weight\": 0.5,\r\n \"dimensionsUOM\": \"in\",\r\n \"length\": 9,\r\n \"width\": 0.25,\r\n \"height\": 6,\r\n \"processingCategory\": \"MACHINABLE\",\r\n \"mailingDate\": \"2023-05-26\",\r\n \"extraServices\": [\r\n 920\r\n ],\r\n \"destinationEntryFacilityType\": \"NONE\",\r\n \"packageOptions\": {\r\n \"packageValue\": 400\r\n }\r\n }\r\n}", |
| 1629 | + "options": { |
| 1630 | + "raw": { |
| 1631 | + "language": "json" |
| 1632 | + } |
| 1633 | + } |
| 1634 | + }, |
| 1635 | + "url": { |
| 1636 | + "raw": "https://api.usps.com/labels/v3/label", |
| 1637 | + "protocol": "https", |
| 1638 | + "host": [ |
| 1639 | + "api", |
| 1640 | + "usps", |
| 1641 | + "com" |
| 1642 | + ], |
| 1643 | + "path": [ |
| 1644 | + "labels", |
| 1645 | + "v3", |
| 1646 | + "label" |
| 1647 | + ] |
| 1648 | + } |
| 1649 | + }, |
| 1650 | + "response": [] |
1549 | 1651 | } |
1550 | 1652 | ] |
1551 | 1653 | }, |
|
1822 | 1924 | } |
1823 | 1925 | ] |
1824 | 1926 | }, |
| 1927 | + { |
| 1928 | + "name": "International Labels", |
| 1929 | + "item": [ |
| 1930 | + { |
| 1931 | + "name": "3.0 International Label", |
| 1932 | + "event": [ |
| 1933 | + { |
| 1934 | + "listen": "test", |
| 1935 | + "script": { |
| 1936 | + "exec": [ |
| 1937 | + "const responseCollection= pm.response.text().split(\"\\n\");\r", |
| 1938 | + "const labelImageData = responseCollection[10]\r", |
| 1939 | + "const labelType = responseCollection[6].split(\" \")[1]\r", |
| 1940 | + "let template = `data:${labelType};base64,${labelImageData}`\r", |
| 1941 | + "//let template = `data:application/octet-stream;base64, ${labelImageData}`\r", |
| 1942 | + "pm.visualizer.set(template)" |
| 1943 | + ], |
| 1944 | + "type": "text/javascript" |
| 1945 | + } |
| 1946 | + } |
| 1947 | + ], |
| 1948 | + "protocolProfileBehavior": { |
| 1949 | + "disableCookies": true, |
| 1950 | + "disabledSystemHeaders": { |
| 1951 | + "accept": true |
| 1952 | + } |
| 1953 | + }, |
| 1954 | + "request": { |
| 1955 | + "auth": { |
| 1956 | + "type": "oauth2", |
| 1957 | + "oauth2": [ |
| 1958 | + { |
| 1959 | + "key": "clientSecret", |
| 1960 | + "value": "", |
| 1961 | + "type": "string" |
| 1962 | + }, |
| 1963 | + { |
| 1964 | + "key": "clientId", |
| 1965 | + "value": "", |
| 1966 | + "type": "string" |
| 1967 | + }, |
| 1968 | + { |
| 1969 | + "key": "accessTokenUrl", |
| 1970 | + "value": "", |
| 1971 | + "type": "string" |
| 1972 | + }, |
| 1973 | + { |
| 1974 | + "key": "tokenType", |
| 1975 | + "value": "", |
| 1976 | + "type": "string" |
| 1977 | + }, |
| 1978 | + { |
| 1979 | + "key": "accessToken", |
| 1980 | + "value": "{{token}}", |
| 1981 | + "type": "string" |
| 1982 | + }, |
| 1983 | + { |
| 1984 | + "key": "client_authentication", |
| 1985 | + "value": "body", |
| 1986 | + "type": "string" |
| 1987 | + }, |
| 1988 | + { |
| 1989 | + "key": "grant_type", |
| 1990 | + "value": "client_credentials", |
| 1991 | + "type": "string" |
| 1992 | + }, |
| 1993 | + { |
| 1994 | + "key": "addTokenTo", |
| 1995 | + "value": "header", |
| 1996 | + "type": "string" |
| 1997 | + } |
| 1998 | + ] |
| 1999 | + }, |
| 2000 | + "method": "POST", |
| 2001 | + "header": [ |
| 2002 | + { |
| 2003 | + "key": "X-Payment-Authorization-Token", |
| 2004 | + "value": "", |
| 2005 | + "type": "text" |
| 2006 | + }, |
| 2007 | + { |
| 2008 | + "key": "Accept", |
| 2009 | + "value": "application/json", |
| 2010 | + "type": "text" |
| 2011 | + } |
| 2012 | + ], |
| 2013 | + "body": { |
| 2014 | + "mode": "raw", |
| 2015 | + "raw": "{\r\n \"imageInfo\": {\r\n \"imageType\": \"PDF\",\r\n \"labelType\": \"4X6LABEL\",\r\n \"packageNumber\": 5,\r\n \"totalPackages\": 50,\r\n \"holdForManifest\": true\r\n },\r\n \"toAddress\": {\r\n \"firstName\": \"Charlie\",\r\n \"lastName\": \"Collins\",\r\n \"firm\": \"MRIF\",\r\n \"phone\": \"33153235555\",\r\n \"streetAddress\": \"118 Avenue De France\",\r\n \"streetAddressAbbreviation\": \"\",\r\n \"secondaryAddress\": \"\",\r\n \"city\": \"Paris\",\r\n \"postalCode\": \"3100020\",\r\n \"province\": \"\",\r\n \"urbanization\": \"yes\",\r\n \"country\": \"France\",\r\n \"countryISOAlpha2Code\": \"FR\"\r\n },\r\n \"fromAddress\": {\r\n \"firstName\": \"Bob\",\r\n \"lastName\": \"Dole\",\r\n \"firm\": \"Postal Service\",\r\n \"phone\": \"1234567890\",\r\n \"streetAddress\": \"901 D ST SW\",\r\n \"streetAddressAbbreviation\": \"\",\r\n \"secondaryAddress\": \"STE 101\",\r\n \"city\": \"Washington\",\r\n \"cityAbbreviation\": \"\",\r\n \"urbanization\": \"\",\r\n \"state\": \"DC\",\r\n \"ZIPCode\": \"20042\",\r\n \"ZIPPlus4\": \"2198\",\r\n \"country\": \"USA\",\r\n \"countryISOAlpha2Code\": \"US\"\r\n },\r\n \"senderAddress\": {\r\n \"firstName\": \"Jill\",\r\n \"lastName\": \"Biden\",\r\n \"firm\": \"Postal Service\",\r\n \"phone\": \"1234567890\",\r\n \"streetAddress\": \"901 D ST SW\",\r\n \"streetAddressAbbreviation\": \"\",\r\n \"secondaryAddress\": \"STE 101\",\r\n \"city\": \"Washington\",\r\n \"cityAbbreviation\": \"\",\r\n \"urbanization\": \"\",\r\n \"state\": \"DC\",\r\n \"ZIPCode\": \"20042\",\r\n \"ZIPPlus4\": \"2198\",\r\n \"country\": \"USA\",\r\n \"countryISOAlpha2Code\": \"US\"\r\n },\r\n \"package\": {\r\n \"mailClass\": \"PRIORITY_MAIL_EXPRESS_INTERNATIONAL\",\r\n \"rateIndicator\": \"PA\",\r\n \"weightUOM\": \"lb\",\r\n \"dimensionsUOM\": \"in\",\r\n \"length\": 11.0,\r\n \"width\": 0.5,\r\n \"height\": 0.5,\r\n \"girth\": 3.0,\r\n \"weight\": 0.5,\r\n \"processingCategory\": \"NON_MACHINABLE\",\r\n \"extraServices\": [],\r\n \"packageOptions\": {\r\n \"packageValue\": 35,\r\n \"nonDeliveryOption\": \"RETURN\"\r\n },\r\n \"destinationEntryFacilityType\": \"NONE\",\r\n \"mailingDate\": \"2023-05-26\",\r\n \"customerReference\": []\r\n },\r\n \"customsForm\": {\r\n \"customsContentType\": \"GIFT\",\r\n \"contentComments\": \"Gift inside!\",\r\n \"restrictionType\": \"QUARANTINE\",\r\n \"restrictionComments\": \"Covid\",\r\n \"AESITN\": \"4783947658\",\r\n \"invoiceNumber\": \"389403\",\r\n \"licenseNumber\": \"092747893\",\r\n \"certificateNumber\": \"CER3629004\",\r\n \"contents\": [\r\n {\r\n \"itemDescription\": \"Gift for Grandma\",\r\n \"itemQuantity\": 1,\r\n \"itemValue\": 2,\r\n \"weightUOM\": \"lb\",\r\n \"itemWeight\": 0.2,\r\n \"HSTariffNumber\": \"HST1234\",\r\n \"countryofOrigin\": \"CA\"\r\n },\r\n {\r\n \"itemDescription\": \"Gift for Grandma\",\r\n \"itemQuantity\": 2,\r\n \"itemValue\": 3,\r\n \"weightUOM\": \"lb\",\r\n \"itemWeight\": 0.3,\r\n \"HSTariffNumber\": \"TN4567\",\r\n \"countryofOrigin\": \"AU\"\r\n }\r\n ]\r\n }\r\n}", |
| 2016 | + "options": { |
| 2017 | + "raw": { |
| 2018 | + "language": "json" |
| 2019 | + } |
| 2020 | + } |
| 2021 | + }, |
| 2022 | + "url": { |
| 2023 | + "raw": "https://api.usps.com/international-labels/v3/international-label", |
| 2024 | + "protocol": "https", |
| 2025 | + "host": [ |
| 2026 | + "api", |
| 2027 | + "usps", |
| 2028 | + "com" |
| 2029 | + ], |
| 2030 | + "path": [ |
| 2031 | + "international-labels", |
| 2032 | + "v3", |
| 2033 | + "international-label" |
| 2034 | + ] |
| 2035 | + } |
| 2036 | + }, |
| 2037 | + "response": [] |
| 2038 | + } |
| 2039 | + ] |
| 2040 | + }, |
1825 | 2041 | { |
1826 | 2042 | "name": "International Prices", |
1827 | 2043 | "item": [ |
|
0 commit comments