Documentation
Linet electronic data interchange API.
Contents
- Releases
- Supported communication protocols
- SOAP - for WSDL service definitions:
- REST - OpenAPI definition click here
-
Enviroments
- Production (PROD) - https://edi.linetgroup.com/
- Development (DEV) - https://ediwebsite-dev-lyzjugdkfuur6.azurewebsites.net
- Development (TEST) - https://ediwebsite-tes-cp2boykfqqsso.azurewebsites.net
- Current - https://edi-test.linetgroup.com
- Authentication methods
- SOAP C# client example
- REST C# client example
- Sample message XML
Releases
| Release | Description |
|---|---|
| 2023-11-? | SalesForce service contract invoices released |
| 2023-09-01 | Navision purchase order released |
| 2023-09-01 | Purchase order confirmation released |
| 2023-08-01 | FSM released |
| 2022-11-30 |
SalesForce connected to platform
|
| 2022-08-31 | ACK message introduced (implemented for SB1 ServiceLayer) |
| 2022-06-09 | All SB1 entities rollout |
| 2022-04-01 | Production enviroment ready for SB1 FR and S4H |
| 2021-11-05 | Relese to TEST enviroment |
Authentication methods
Entire API supports basic HTTP authentication and OAuth2.0 authentication (Microsoft identity platform)
OAuth2.0 authentication
Client applications are authorized by OAuth2.0 client credentials grant flow. For testing purposes, resource owner password credentials flow can be used (especialy when testing via Swagger UI). If resource owner password credentials flow is used, allowing App.Default scope is required.
HTTP basic authentication
Basic authentication is enabled. Client application is assigned username and password.
SOAP C# example
Use Visual studio tool svcutil.exe to generate client from WSDL. API WSDL available here.
Configure your client
Create partial class MessageGatewayClient and override ConfigureEndpoint method to fill you credentials:
OAuth2.0 authentication
oAuth authentication for SOAP service is currently not supported.
Basic authentication
namespace EdiService.Soap
{
public partial class MessageGatewayClient : System.ServiceModel.ClientBase, EdiService.Soap.IMessageGateway
{
static partial void ConfigureEndpoint (System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials)
{
(serviceEndpoint.Binding as BasicHttpBinding).Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
clientCredentials.UserName.UserName = "your-client-id";
clientCredentials.UserName.Password = "your-client-secret";
serviceEndpoint.Address = new System.ServiceModel.EndpointAddress("https://edi-test.linetgroup.com/SOAP/EDI/MessageGateway.svc");
}
}
[System.Runtime.Serialization.KnownTypeAttribute(typeof(XmlElement))]
public partial class EDIMessageEnvelope : object { }
}
Make API call
SayHello test method
EdiService.Soap.MessageGatewayClient client = new EdiService.Soap.MessageGatewayClient(EdiService.Soap.MessageGatewayClient.EndpointConfiguration.BasicHttpBinding_IMessageGateway_soap); var result = await client.SayHelloAsync();
Push EDI message
EdiService.Soap.MessageGatewayClient client = new EdiService.Soap.MessageGatewayClient(EdiService.Soap.MessageGatewayClient.EndpointConfiguration.BasicHttpBinding_IMessageGateway_soap); EdiService.Soap.EDIMessageEnvelope envelope = new EdiService.Soap.EDIMessageEnvelope(); XmlDocument doc = new XmlDocument(); doc.Load(Path.Combine(AppContext.BaseDirectory, "SampleXML/ORDERS05.xml")); envelope.BasicType = doc.DocumentElement["BasicType"].InnerText; envelope.MessageType = doc.DocumentElement["MessageType"].InnerText; envelope.GUID = Guid.NewGuid().ToString(); envelope.Sender = doc.DocumentElement["Sender"].InnerText; envelope.Reciever = doc.DocumentElement["Reciever"].InnerText; envelope.Body = doc.DocumentElement["Body"]["ORDERS05"]; var result = await client.PushEDIEnvelopeAsync(envelope);
REST C# Example
Use nswag to generate client from Open API json specification. Metadata Swagger.json available here.
Configure your client
Create partial class EdiServiceRest and override PrepareRequest partial method to fill your credentials
OAuth2.0
namespace EdiService.Rest
{
public partial class EdiServiceRest
{
private string bearerToken;
partial void PrepareRequest (System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url)
{
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", bearerToken);
}
public async Task PrepareBearerToken(){
var authClient = ConfidentialClientApplicationBuilder
.Create("your-client-id)
.WithClientSecret("your-client-secret")
.WithAuthority(new System.Uri("https://login.microsoftonline.com/fa7c3252-ed1a-4f70-b2c4-5134ba3f9cfd")) //Azure AD Linet tenant
.Build();
var authResult = await authClient.AcquireTokenForClient(new string[] { "api://c1374b57-9710-4d75-8096-75d7b169d738/.default" }).ExecuteAsync(); //LinetEDIApi clientId
this.bearerToken = authResult.AccessToken;
}
}
}
Basic authentication
namespace EdiService.Rest
{
public partial class EdiServiceRest
{
partial void PrepareRequest (System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url){
string username = "your-client-id";
string password = "your-client-secret";
string svcCredentials = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(username + ":" + password));
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", svcCredentials);
}
}
}
Make API call
SayHello test method
EdiService.Rest.EdiServiceRest service = new EdiService.Rest.EdiServiceRest("https://edi-test.linetgroup.com", new HttpClient());
await service.PrepareBearerToken(); //use only with oAuth2.0 authentication
var hello = await service.SayHelloAsync(); //returns Hello $"{username}"
Push EDI message
EdiService.Rest.EdiServiceRest service = new EdiService.Rest.EdiServiceRest("https://edi-test.linetgroup.com", new HttpClient());
XmlDocument doc = new XmlDocument();
doc.Load(Path.Combine(AppContext.BaseDirectory, "SampleXML/ORDERS05.xml"));
await service.PrepareBearerToken(); //use only with oAuth2.0 authentication
EdiService.Rest.EDIMessageResponse result = await service.PushEDIEnvelopeAsync(doc.OuterXml);