Web Service

Sending Messages To Crossfire

Messages can be delivered to Crossfire by posting to the Crossfire HTTP service.  Details of the service for delivery are below.  Please request a URL and credentials from the Crossfire team. 


HTTP Service

URL is client-specific, e.g. https://service.crossfireedi.com/api/fox-paperless


Authentication

Standard HTTP Basic Authentication.  Credentials are client specific.


Payload

The file/message content is contained in the payload.


Content Type 

Multiple supported:  text/xml, application/json, application/xml, application/octet


Sample HTTP Request

POST /api/fox-paperless HTTP/1.1

Host: service.crossfireedi.com

Content-Type: application/xml

Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

Cache-Control: no-cache


<test>Sample message content</test>


Sample HTTP Response

Cache-control: private

Content-encoding: gzip

Content-length: 174

Content-type: text/html; charset=utf-8

Date: Mon, 14 Jun 2021 06:09:00 GMT


<CrossfireResult>

    <Result>Success</Result>

    <MessageID>188249738</MessageID>

</CrossfireResult>





Receiving Messages From Crossfire


Crossfire Push

Crossfire can deliver messages using HTTP Post to a hosted endpoint, exactly as described in the earlier section, but supporting HMAC, Basic Auth, OAuth, NTLM, or fixed token authentication.  This is the most common type of message transfer. 



Extracting From Crossfire

Alternatively, we have an extraction service available.  By making an HTTP request, the message at the top of the queue will be returned.   When no messages are left in the queue, a response indicating that will be provided. 


Service

URL: https://service.crossfireedi.com/api/download


Authentication

Standard HTTP Basic Authentication.  Credentials are client specific.


Sample HTTP Request

GET /download.aspx HTTP/1.1

Host: service.crossfireedi.com

Content-Type: application/xml

Authorization: Basic VGVzdFBpY2t1cC05aAyODk5OxVBUVJRVXNCMzhxeDNtRGU=

Cache-Control: no-cache


Sample HTTP Response

Cache-control: private

Content-encoding: gzip

Content-length: 1737

Content-type: text/html; charset=utf-8

Date: Mon, 14 Jun 2021 06:30:01 GMT


<PURCHASE_ORDER_150 partner="FOODSTUFFS" transaction="PURCHASEORDER" version="1.50" timestamp="2021-05-26T07:47:33" document_mode="Test">

    <CUSTOMER>

            <NAME>Hastings PAKnSAVE</NAME>

    </CUSTOMER>

</PURCHASE_ORDER_150>




Crossfire has multiple web services available. 

Services For Message Exchange

These are services used for sending messages to Crossfire.   The service can return a synchronously processed response if configured. 

The difference between these two services is the way in which they are connected to.  Rest based web services are where data is sent as an HTTP Post to the endpoint. 

Legacy Microsoft ASMX Web Service

This service is available at the /Crossfire.asmx extension of your service URL.   E.g. https://servicetest.crossfireedi.com/Crossfire.asmx

Requests

There are are the following operations available

Transports used must be of type 'Incoming Processor'. 

Response 

The service will return a 200 response, with no other data.   Unless the "SubmitWithTransportSynchronous" operation is used, and the transport has the 'Synchronous' checkbox checked, then the response will contain the translated message. 

Authentication

The "authenticationMethod" can be set to either BASIC or BEARER.  

Basic authentication matches the provided details to the Username and Password specified on the Transport. 

Bearer authentication matches the provided bearer token to the Bearer token specified on the Transport. 

REST/POST Web Service 

This is the preferred service to use.  The URL of this service is specified per Transport, giving each client a unique URL to use. 

The URL is specified as in the picture below

Requests

A plain HTTPS Post is performed to the endpoint (can be tested in postman or similar).   The request contains the string content of the message being sent to Crossfire. 

Check the 'Synchronous' box, and specify a "Response Transport" if you require the service to return a response of the translated message.  The Response Transport is the name of an 'Outgoing Processor' Transport which is typically the output of the translation.

Authentication

Basic Authentication is supported.  This means the Basic Auth details match the provided details to the Username and Password specified on the Transport. 

If the username and password are left blank, no authentication is in place. 

Response 

The service will return a 200 response, with no other data.    If the Synchronous option is enabled and the Response Transport is set, then the response will be the output message. 

Service for Interacting with the Crossfire Product

This is a web service which allows automation of the Crossfire product.   It exposes operations for the following

This service is an ASMX based Microsoft Web Service.   An example of the service can be found below on the Crossfire Cloud Test Service endpoint.

https://servicetest.crossfireedi.com/Crossfire.asmx

Web Service V2

Authorisation

Endpoints

/Auth.aspx

This is OAuth2 token endpoint.

Pass in the username and password (the same login credential to the Crossfire EDI Portal) with grant type in the payload.

/Crossfire.aspx?ShortURL=<value_in_the_transport>

This endpoint only works for the Incoming Web Service transport type.

This will upload the message from the payload and save it to the Incoming Web Service transport.

Auth:

It supports both Basic and OAuth2 authorisation.

/api/<value_in_the_transport>

This is the same as the "/Crossfire.aspx?ShortURL=<value_in_the_transport>" if you have the URL rewrite set up in IIS.

Auth:

It supports both Basic and OAuth2 authorisation.

/Crossfire.aspx?TransportName=<transport_name>

This is the same as the "/Crossfire.aspx?ShortURL=<value_in_the_transport>", but this endpoint allows you to upload the message to any transport.

Auth:

It supports only OAuth2 authorisation.

/CrossfireService.aspx

This is a more advanced version of Crossfire.aspx endpoint. For this endpoint, you can specify how the message should be structured, etc., and then save the message to the "TransportName."

This is a sample message:

<Message>

    <DocumentType />

    <Version />

    <ReplyTo />

    <Subject>Test transport</Subject>

    <Body>Example Body</Body>

    <TextBody />

    <TransportName>[Nick] File Out</TransportName>

    <MaximumRetryAttempts>5</MaximumRetryAttempts>

    <Reference>123456</Reference>

    <From>WebService Test</From>

    <OriginalMessage />

    <Attachments>

        <Attachment>

            <Filename>Test.xml</Filename>

            <Data>

                <Content>Test Data</Content>

            </Data>

            <IsBase64>false</IsBase64>

        </Attachment>

    </Attachments>

</Message>