Usage

Swagger UI.

Security

To perform requests you have to create a user here. This user will be used to authorize requests via Basic Authentication (Authorization: Basic base64(username:password))

Send request

To send request you have to use HTTP POST /proxy method.
Input body of this method requires few parameters:
  1. externalSystemHttpMethod * - HTTP method that will be used during HTTP request to external system
  2. externalSystemUrl * - full URL to external system endpoint. Add all query parameters to this url if needed
  3. body - body that will be sent to external system. base64 for file or stringified json(quotes are escaped), or xml
  4. headers - array of headers that will be sent to external system. Note that you have to pass all headers that are required
  5. webhookUrl - URL from your system that will be triggered once the request is completed
Also you have to pass Authorization header to perform this operation(see security description)

Example of usage

Assume you want to send request to endpoint HTTP PUT https://example.com/api/test-endpoint with JSON data { "key1": 1, "key2": "qwerty" } and at the end of request you want to receive a notification on endpoint https://my-service.com/api/sync-request-done-webhook
Then you have to send following JSON data
  {
    "body": "{ \"key1\": 1, \"key2\": \"qwerty\" }",
    "externalSystemHttpMethod": "PUT",
    "externalSystemUrl": "https://example.com/api/test-endpoint",
    "headers": [
      {
        "name": "Content-Type",
        "value": "application/json"
      }
      // any other headers that are required for request to endpoint "https://example.com/api/test-endpoint" goes here like (ex: authorization headers, Accept, Origin etc.)
    ],
    "webhookUrl": "https://my-service.com/api/sync-request-done-webhook"
  }
        
to endpoint HTTP POST /proxy method of this server additionally you will have to pass Authorization header

Webhook

Once the request will be completed the sync-server will trigger webhook in the following way HTTP GET https://my-service.com/api/sync-request-done-webhook?proxyId=ID_OF_PROXY_REQUEST
Note: you can also pass custom query parameters to webhook - https://my-service.com/api/sync-request-done-webhook?param1=2&param3=qwerty in this case following webhook request will be sent - HTTP GET https://my-service.com/api/sync-request-done-webhook?param1=2&param3=qwerty&proxyId=ID_OF_PROXY_REQUEST
Note 2: as user you can add additional headers to your webhook here. After log-in you will be able to add list of headers that will be passed to yours backend during webhook

Get response info from external system once request is completed

Once request is completed you will receive webhook with proxy ID (you also can get this ID during creation of new proxy request. check model ProxyResultDto and it's parameter id on Swagger UI)
With this Proxy ID you can get response from endpoint HTTP GET /proxy/{PROXY_ID} method. You can also use this method for pulling to get the result in case webhook is not suites you needs. This method requires Authorization header(see Security part)
Proxy request and response will be stored for 7 days from time of it's creation. Once it's deleted you will receive 404 HTTP Status code for request HTTP GET /proxy/{PROXY_ID} method