Get receivers#
This endpoint is used to get all or filtered integrated receiver entities.
Endpoint steps#
Get a token from your credentials by calling the endpoint Account/getToken;
Get all integrated destinations calling the endpoint CompanyConnections/destinations or filtred integrated destinations by CompanyConnections/destinations/{searchValue};
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
server_base_adress = "dcn-solution.saphety.com/Dcn.Sandbox.WebApi"
# Saphety Invoice Network - Production Environment
#server_base_adress = "dcn-solution.saphety.com/Dcn.Business.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 receivers (CompanyConnections/destinations OR CompanyConnections/destinations/{searchValue})#
* Note: Here we will use the endpoint CompanyConnections/destinations/{searchValue} to get just one integrated company, searching for the company name. But you can use the endpoint CompanyConnections/destinations to get all integrated companies!
2.1 Request structure#
In the endpoint url you have the option to supply the searchValue
searchValue#
Description: The vat number or the name of the company
Required: No
Type: string
Example: “Company name”
2.2 Request example#
searchValue = "TRUSTED"
# SIN endpoint url for retrieving inforfation on invoice previously sent
service_url = "https://" + server_base_adress + "/api/CompanyConnections/destinations/" + searchValue
print (service_url)
https://dcn-solution.saphety.com/Dcn.Sandbox.WebApi/api/CompanyConnections/destinations/TRUSTED
2.3 Call the endpoint to get the integrated destination#
Get the integrated destination companies, filtering with a search value using the endpoint /api/CompanyConnections/destinations/{searchValue}
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))
[
{
"IntlVatCode": "PT507957547",
"CompanyName": "SAPHETY LEVEL - TRUSTED SERVICES, S.A.",
"AddressLine": "Rua do Viriato, N\u00ba13 - 3\u00baPISO",
"City": "LISBOA",
"ZipCode": "1050-233",
"ZipArea": "LISBOA",
"CountryCode": "PT",
"CommercialRecordWebCode": "",
"TenantCode": null,
"LanguageCode": "pt",
"Status": "Active",
"IsPartner": false,
"CreationDate": "2010-09-29 15:25"
}
]