{
  "info": {
    "name": "Integration WEB",
    "schema": "{{postmanCollectionUrl}}",
    "description": "Web identification and web signing flow. Sanitized public template: replace variables such as {{relyingPartyId}}, {{clientCertificate}}, {{callbackUrl}}, {{email}}, {{phone}}, {{personalIdentifier}}, {{documentBase64}} before use."
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://cqes-rpuat.b-trust.bg"
    },
    {
      "key": "acceptLanguage",
      "value": "bg"
    },
    {
      "key": "relyingPartyId",
      "value": ""
    },
    {
      "key": "clientCertificate",
      "value": ""
    },
    {
      "key": "callbackUrl",
      "value": ""
    },
    {
      "key": "email",
      "value": ""
    },
    {
      "key": "phone",
      "value": ""
    },
    {
      "key": "personalIdentifier",
      "value": ""
    },
    {
      "key": "documentBase64",
      "value": ""
    },
    {
      "key": "uuid",
      "value": ""
    },
    {
      "key": "sessionId",
      "value": ""
    },
    {
      "key": "resultId",
      "value": ""
    },
    {
      "key": "signSessionId",
      "value": ""
    },
    {
      "key": "accessToken",
      "value": ""
    },
    {
      "key": "signatureId",
      "value": ""
    },
    {
      "key": "relyingPartyID",
      "value": "",
      "type": "string"
    },
    {
      "key": "X-CLIENT-CERT",
      "value": "",
      "type": "string"
    },
    {
      "key": "certId",
      "value": "",
      "type": "string"
    },
    {
      "key": "personalNumber",
      "value": "",
      "type": "string"
    },
    {
      "key": "documentNumber",
      "value": "",
      "type": "string"
    },
    {
      "key": "successUrl",
      "value": "",
      "type": "string"
    },
    {
      "key": "cancelUrl",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "1. Start web identification session",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept-language",
            "value": "{{acceptLanguage}}",
            "type": "text"
          },
          {
            "key": "relyingPartyID",
            "value": "{{relyingPartyId}}",
            "type": "text"
          },
          {
            "key": "X-CLIENT-CERT",
            "value": "{{clientCertificate}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://cqes-rpuat.b-trust.bg/signing-api/v2/identification/web/start",
          "protocol": "https",
          "host": [
            "cqes-rpuat",
            "b-trust",
            "bg"
          ],
          "path": [
            "signing-api",
            "v2",
            "identification",
            "web",
            "start"
          ]
        },
        "description": "",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"callbackUrl\": \"{{callbackUrl}}\",\n  \"returnUrl\": \"{{returnUrl}}\",\n  \"processType\": \"CREATE_SIGN_SESSION_REQUEST\",\n  \"language\": \"bg\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    },
    {
      "name": "2. Returns the status and the step of web identification",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept-language",
            "value": "{{acceptLanguage}}",
            "type": "text"
          },
          {
            "key": "relyingPartyID",
            "value": "{{relyingPartyId}}",
            "type": "text"
          },
          {
            "key": "X-CLIENT-CERT",
            "value": "{{clientCertificate}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://cqes-rpuat.b-trust.bg/signing-api/v2/identification/web/{{resultId}}/status",
          "protocol": "https",
          "host": [
            "cqes-rpuat",
            "b-trust",
            "bg"
          ],
          "path": [
            "signing-api",
            "v2",
            "identification",
            "web",
            "{{resultId}}",
            "status"
          ]
        },
        "description": ""
      },
      "response": []
    },
    {
      "name": "3. Generate OTP for one-time-certificate",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept-language",
            "value": "{{acceptLanguage}}",
            "type": "text"
          },
          {
            "key": "relyingPartyID",
            "value": "{{relyingPartyId}}",
            "type": "text"
          },
          {
            "key": "X-CLIENT-CERT",
            "value": "{{clientCertificate}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://cqes-rpuat.b-trust.bg/signing-api/v2/identification/web/generate/otp/{{resultId}}",
          "protocol": "https",
          "host": [
            "cqes-rpuat",
            "b-trust",
            "bg"
          ],
          "path": [
            "signing-api",
            "v2",
            "identification",
            "web",
            "generate",
            "otp",
            "{{resultId}}"
          ]
        },
        "description": ""
      },
      "response": []
    },
    {
      "name": "4. Validate OTP code for one-time-certificate",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept-language",
            "value": "{{acceptLanguage}}",
            "type": "text"
          },
          {
            "key": "relyingPartyID",
            "value": "{{relyingPartyId}}",
            "type": "text"
          },
          {
            "key": "X-CLIENT-CERT",
            "value": "{{clientCertificate}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://cqes-rpuat.b-trust.bg/signing-api/v2/identification/web/validate/otp",
          "protocol": "https",
          "host": [
            "cqes-rpuat",
            "b-trust",
            "bg"
          ],
          "path": [
            "signing-api",
            "v2",
            "identification",
            "web",
            "validate",
            "otp"
          ]
        },
        "description": "",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"resultId\": \"{{resultId}}\",\n  \"secret\": \"{{otpCode}}\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    },
    {
      "name": "5. Returns the result of successful process of web identification",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept-language",
            "value": "{{acceptLanguage}}",
            "type": "text"
          },
          {
            "key": "relyingPartyID",
            "value": "{{relyingPartyId}}",
            "type": "text"
          },
          {
            "key": "X-CLIENT-CERT",
            "value": "{{clientCertificate}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://cqes-rpuat.b-trust.bg/signing-api/v2/identification/web/{{resultId}}/result/{{processState}}/{{websessionID}}/{{onlyMetadata}}",
          "protocol": "https",
          "host": [
            "cqes-rpuat",
            "b-trust",
            "bg"
          ],
          "path": [
            "signing-api",
            "v2",
            "identification",
            "web",
            "{{resultId}}",
            "result",
            "{{processState}}",
            "{{websessionID}}",
            "{{onlyMetadata}}"
          ]
        },
        "description": ""
      },
      "response": []
    },
    {
      "name": "6. Start sign session for signing documents",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept-language",
            "value": "{{acceptLanguage}}",
            "type": "text"
          },
          {
            "key": "relyingPartyID",
            "value": "{{relyingPartyId}}",
            "type": "text"
          },
          {
            "key": "X-CLIENT-CERT",
            "value": "{{clientCertificate}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://cqes-rpuat.b-trust.bg/signing-api/v2/identification/web/signSession/start",
          "protocol": "https",
          "host": [
            "cqes-rpuat",
            "b-trust",
            "bg"
          ],
          "path": [
            "signing-api",
            "v2",
            "identification",
            "web",
            "signSession",
            "start"
          ]
        },
        "description": "",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"identificator\": \"{{clientIdentificator}}\",\n  \"signSessionId\": \"{{signSessionId}}\",\n  \"documentsForSign\": [\n    {\n      \"contentAsBase64\": \"{{documentBase64}}\",\n      \"fileName\": \"document.pdf\",\n      \"legalFileName\": \"document\",\n      \"padesVisualSignature\": true,\n      \"signaturePosition\": {\n        \"imageHeight\": 100,\n        \"imageWidth\": 160,\n        \"imageXAxis\": 50,\n        \"imageYAxis\": 50,\n        \"pageNumber\": 1\n      },\n      \"toBeArchived\": false\n    }\n  ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    },
    {
      "name": "7. Revoke web sign session",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept-language",
            "value": "{{acceptLanguage}}",
            "type": "text"
          },
          {
            "key": "relyingPartyID",
            "value": "{{relyingPartyId}}",
            "type": "text"
          },
          {
            "key": "X-CLIENT-CERT",
            "value": "{{clientCertificate}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://cqes-rpuat.b-trust.bg/signing-api/v2/identification/web/signSession/revoke/{{signSessionId}}",
          "protocol": "https",
          "host": [
            "cqes-rpuat",
            "b-trust",
            "bg"
          ],
          "path": [
            "signing-api",
            "v2",
            "identification",
            "web",
            "signSession",
            "revoke",
            "{{signSessionId}}"
          ]
        },
        "description": ""
      },
      "response": []
    }
  ]
}