Get networks#

This endpoint is used to get the list of networks available for interoperability.

Endpoint steps#

  1. Get a token from your credentials by calling the endpoint Account/getToken;

  2. Get all the networks available calling the endpoint BusinessGroups/all from IntegrationAccess API URL;

Response structure from server#

When a request is well formed and the authentication data is correct the system responds with a message envelope as follows:

{
	"CorrelationId": "<GUID>", /* for correlation purposes */
	"IsValid": true,           /* false in case of erros */
	"Errors": [],              /* if empty is a good signal */
	"Data": "<Service Response Data>"   /* the data retuned ex: token, invoice status, dependent on the endpoint called */
}

Endpoint Server Base URL#

# SANDBOX - Test Environment
integration_access_server_base_adress = "dcn-solution.saphety.com/Dcn.Sandbox.WebApi"

# Saphety Invoice Network - Production Environment
#integration_access_server_base_adress = "dcn-solution.saphety.com/IN2.IntegrationAccess.WebApi"

1. Get a token (Account/getToken)#

Get a token from your account credentials using endpoint api/Account/getToken
Check here how to obtain an authentication token.

2. Get networks available (BusinessGroups/all)#

2.1 Request example#

# WebStore endpoint url for retrieving information
service_url = "https://" + integration_access_server_base_adress + "/api/BusinessGroups/all"
print (service_url)
https://dcn-solution.saphety.com/Dcn.Sandbox.WebApi/api/BusinessGroups/all

2.2 Call the endpoint to get the networks available#

Get the networks available using endpoint /api/BusinessGroups/all

headers = {
    'Authorization': 'bearer ' + token
}
response = requests.request("GET", service_url, headers=headers)

# formating the response to json for visualization purposes only
json_response = json.loads(response.text)
print(json.dumps(json_response["Data"], indent=4))
[
    {
        "Code": "Dcn",
        "DocServerCode": "Dcn",
        "RequiresConditionsAcceptence": false,
        "RequiresActivationFeatures": false,
        "Features": []
    },
    {
        "Code": "Espap",
        "DocServerCode": "ESPAP",
        "RequiresConditionsAcceptence": true,
        "RequiresActivationFeatures": false,
        "Features": []
    },
    {
        "Code": "iLink",
        "DocServerCode": "SIN_eINV_iLink",
        "RequiresConditionsAcceptence": false,
        "RequiresActivationFeatures": true,
        "Features": [
            {
                "FeatureCode": "iLinkIntegrationAccess",
                "ForActivation": true
            },
            {
                "FeatureCode": "Interconnect",
                "ForActivation": false
            }
        ]
    }
]

The available “Codes” are:

  • Dcn

  • Espap

  • Generix

  • iLink

  • Indra

  • Seres

  • Yet