Get network receivers#

This endpoint is used to get the list of receiver entities available within a specific network.

Endpoint steps#

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

  2. Get the network receivers 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 network available (BusinessGroups/{groupCode}/destinations)#

2.1 Request structure#

In the endpoint url you need to supply the groupCode

groupCode#

  • Description: The group code identification

  • Required: Yes

  • Type: string

  • Example: “iLink”

2.2 Request example#

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

2.3 Call the endpoint to get the network receivers#

Get the network receivers using endpoint /api/BusinessGroups/{groupCode}/destinations

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, ensure_ascii=False))
[
    {
        "IntlVatCode": "PT502173297",
        "CompanyName": "MUNICÍPIO DE PAÇOS DE FERREIRA",
        "AddressLine": "PRAÇA DA REPÚBLICA, 46",
        "City": null,
        "ZipCode": "4590-527",
        "ZipArea": "PAÇOS DE FERREIRA",
        "CountryCode": "PT",
        "LanguageCode": null
    },
    {
        "IntlVatCode": "PT600044742",
        "CompanyName": "SAS - INSTITUTO POLITÉCNICO DE VISEU",
        "AddressLine": "Av. Coronel José Maria Vale de Andrade - Campus Politécnico",
        "City": null,
        "ZipCode": "3504-510",
        "ZipArea": "Viseu",
        "CountryCode": "PT",
        "LanguageCode": null
    }
]