Portal Web Services
End Point – SOAP URL: http://services.dfsmail.com/services/ClientPortalService.svc Encoding – MTOM Upload File Size Limit – 250 MB
Token
To generate a token (API Key), the proper security role needs to be added to your user account from DFS. The API key will be linked to the specific user, therefore, that user must have proper permissions to perform actions on behalf of that customer.
• URL: http://security.dfsmail.com/ • Click on Api Keys menu option and click add to generate a new Token. (example below)


Add the Token to the service reference configuration inside the endpoint section. Example:
<bindings>
<basicHttpBinding>
<binding name="BasicHttpsBinding_IClientPortalService" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" messageEncoding="Mtom" sendTimeout="05:00:00">
<security mode="Transport"/>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://services.dfsmail.com/services/ClientPortalService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpsBinding_IClientPortalService" contract="ClientPortal.IClientPortalService" name="BasicHttpsBinding_IClientPortalService">
<headers>
<token>{API KEY}</token>
</headers>
</endpoint>
</client>Notes
- The Customer Number (Id) is required as a parameter in all the methods to avoid conflict of getting or updating information from another customer.
- To find Customers Id, use the GetCustomers() method the get a list of Customers and their Ids for that user.
- If the Start and End Date are sent as null it will automatically search for the last seven days.
- The maximum date range for the search is 31 days if is more than that the service will throw an exception.
Methods
//Get all the Work Orders pending for authorization for the specified customer and Job Name.
IEnumerable<e.WorkOrder> GetWorkOrderPendingAuthorizationByJobName (int customerId, string jobName);
//Approve a Work Order (Job) with pending for authorization status sending Customer Id and Work Order Id (Job Id)
bool AproveJob(int customerId, int jobId);
//Reject a Work Order (Job) with pending for authorization status sending Customer Id and Work Order Id (Job Id)
bool RejectJob(int customerId, int jobId, string comments);
//Get a list of open Work Orders (Jobs)
IEnumerable<e.WorkOrderDetails> GetAllWorkOrders(int customerId);
//Get a list of open Work Orders (Jobs) with a specific status.
IEnumerable<e.WorkOrderDetails> GetWorkOrdersByStatus(int customerId, string status);
//Get a list of open Work Orders (Jobs) with a date range.
IEnumerable<e.WorkOrderDetails> GetWorkOrdersByDate(int customerId, DateTime? startDate, DateTime? endDate);
//Get a list of closed Work Orders (Jobs) with a date range.
IEnumerable<e.WorkOrder> GetAllWorkOrdersHistory(int customerId, DateTime? startDate = null, DateTime? endDate = null);
//Get Customer current postage balance.
decimal GetCurrentBalance(int customerId);
//Get a list of postage records by date range.
IEnumerable<e.PostageHistory> GetPostageHistoryList (int customerId, DateTime? startDate = null, DateTime? endDate = null, string type = null);
//Get a list of items related to the customer.
IEnumerable<e.Item> GetAllItems(int customerId);
//Get a list of items related to the customer and contains the name sent in the parameter.
IEnumerable<e.Item> GetItemsByName(int customerId, string itemName);
//Get list of related customers to the user (Customer , Customer Name)
Dictionary<int, string> GetCustomers();
//Upload file to Portal Customers Files
void UploadFiles(int customerId, string filename, System.IO.Stream file);
Example
Service.ClientPortalServiceClient client = new Service.ClientPortalServiceClient();
String filePath = (@"C:\testUpload.zip"); FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read); client.UploadFiles(137, "testUpload.zip", fs);
Entities
public class Item { public string Number { get; set; } public string Name { get; set; } public int QtyTotalAtDay { get; set; } }
public class PostageHistory { public int? Id { get; set; } public DateTime PaymentDate { get; set; } public string TransactionType { get; set; } public int? WorkOrderId { get; set; } public decimal Amount { get; set; } public decimal StartingBalance { get; set; } public decimal EndingBalance { get; set; } public string Reference { get; set; } } public class WorkOrder { public int Id { get; set; } public string Name { get; set; } public DateTime CreateDate { get; set; } public DateTime? DueDate { get; set; } public string Status { get; set; } } public class WorkOrderDetails : WorkOrder { public string StatusId { get; set; } public int CustomerId { get; set; } public string CustomerName { get; set; } public DateTime ArrivalDate { get; set; } public DateTime DepartureDate { get; set; } public int PrintingPercentage { get; set; } public int InsertingPercentage { get; set; } }