gilbertrios | Posts: 3

How to respond to an Event Notification for PACKAGE_READY_FOR_COMPLETION

0 votes
if (!EventHandler.ContainsKey(NotificationEvent.PACKAGE_READY_FOR_COMPLETION)) EventHandler.Add(NotificationEvent.PACKAGE_READY_FOR_COMPLETION, (EventRequest request) => { // RESPONSE TO Set Status to Completed });

mwilliams | Posts: 957

Reply to: How to respond to an Event Notification for PACKAGE_READY_FOR_COMPLETION

0 votes
I have moved your post from "Enhancement Ideas" to ".NET SDK", as Ahmad told me you are using C#. Is this the case? Or are you wanting to use the REST API? Let me know.

mwilliams | Posts: 957

Reply to: How to respond to an Event Notification for PACKAGE_READY_FOR_COMPLETION

0 votes
In C# (with the .NET SDK), you can mark as complete with the following code. Note: You will need to upgrade to the 10.10.1 SDK, if not already using it:
EslClient eslClient = new EslClient(apiKey, apiUrl);
PackageId packageId = new PackageId("c69d12d4-e7e9-4e98-8ef5-c25787b1d6e3");
Signer mysigner = eslClient.GetPackage(packageId).GetSigner("[email protected]"); // only need if you want to accept attachment
eslClient.AttachmentRequirementService.AcceptAttachment(packageId, mysigner, "Attachment1"); //accept the attachment as the proper attachment
eslClient.PackageService.MarkComplete(packageId);
If you want to use REST instead, let me know.

gilbertrios | Posts: 3

Reply to: How to respond to an Event Notification for PACKAGE_READY_FOR_COMPLETION

0 votes
.NET Project references Silanis.ESL.SDK version 10.9.0.0

mwilliams | Posts: 957

Reply to: How to respond to an Event Notification for PACKAGE_READY_FOR_COMPLETION

0 votes
Is there any way you can upgrade your SDK to the latest?

gilbertrios | Posts: 3

Reply to: How to respond to an Event Notification for PACKAGE_READY_FOR_COMPLETION

0 votes
Hi Michael, Thanks for the quick response. I appreciate your support. Is there any way we can produce the same results with version 10.9.0.0 we are unable to upgrade to 10.10 at this point due to time constraints.

mwilliams | Posts: 957

Reply to: How to respond to an Event Notification for PACKAGE_READY_FOR_COMPLETION

0 votes
With REST, you'd do something like this:
HttpClient myClient = new HttpClient();
myClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", apiKey);
myClient.DefaultRequestHeaders.Add("Accept", "application/json,application/zip,text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
string content = "{\"status\":\"COMPLETED\"}";
StringContent json = new StringContent(content, Encoding.UTF8, "application/json");
var response = myClient.PostAsync(new Uri(apiUrl + "/packages/" + packageId + "?"), json).Result;
Hope this helps.

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off