find signature is required or not using shipment API (USPS, UPS, DHL, FeDex) - fedex

I am integrating the Carrier (USPS, UPS, DHL, FeDex) API with my application.
For that i need to find different statuses for that shipment like is it delivered or not, which is getting me properly.
Similarly, i need to check whether the shipment required the signature or not?
How do i came to know this using the different API?
Regards,
Salil Gaikwad

Not all APIs support the same functionality. All will tell you the current status and some will provide the shipper/recipient information but I don't believe any will tell you if it was sent signature required.

E.g. for FedEx if you want to know about parcel's tracking events (delivered or not, any problems, delivery time and many other info) use this service endpoint - https://ws.fedex.com:443/web-services/track. The request to FedEx will be look like this (C# sample):
TrackRequest request = new TrackRequest();
request.WebAuthenticationDetail = new WebAuthenticationDetail();
request.WebAuthenticationDetail.UserCredential = new WebAuthenticationCredential()
{
Key = "ApiKey",
Password = "PasswordKey"
};
request.ClientDetail = new ClientDetail
{
AccountNumber = "...",
MeterNumber = "..."
};
request.TransactionDetail = new TransactionDetail();
request.PackageIdentifier = new TrackPackageIdentifier();
request.PackageIdentifier.Value = "parcel tracking number";
request.PackageIdentifier.Type = TrackIdentifierType.TRACKING_NUMBER_OR_DOORTAG;
request.IncludeDetailedScans = true;
request.IncludeDetailedScansSpecified = true;
request.Version = new VersionId();
When you receive from FedEx - TrackReply, you should check TrackDetails array. There will be tracking info. As for other carriers, the common idea is the same. Almost every carrier use tracking number.

Related

UCWA MyOnlineMeeting attendees requirements? External attendees

I'm currently trying to develop an application that creates Skype meetings.
I'm leveraging the C# UCWA SDK and developing against Skype for Business online.
Meeting creation works fine if I only include people from the tenant in attendees, as soon as I include people not from the tenant in the meeting I get this error message:
{"code":"BadRequest","subcode":"ParameterValidationFailure","message":"Please check what you entered and try again.","debugInfo":{"diagnosticsCode":"2"}}
Here is my code sample
var meeting = new MyOnlineMeeting()
{
AccessLevel = AccessLevel.Everyone,
Attendees = new string[] { $"sip:{Settings.SkypeUserEmail}" }, //Adding anybody else than the service account makes it fail for now
Subject = series.Subject,
ExpirationTime = DateTime.Now.AddDays(3),
AutomaticLeaderAssignment = AutomaticLeaderAssignment.SameEnterprise,
Leaders = series.Organizers.Select(x => $"sip:{x.EmailAddress}").ToArray(),
LobbyBypassForPhoneUsers = LobbyBypassForPhoneUsers.Enabled,
PhoneUserAdmission = PhoneUserAdmission.Disabled
};
var dialIn = await client.OnlineMeetings.GetPhoneDialInInformation();
var meetings = await client.OnlineMeetings.GetMyOnlineMeetings();
var result = await meetings.Create(meeting);
Adding external users to the organizers properties works fine though.
My question is: how can I add external attendees to the meeting I'm creating? Is there anything specific around attendees?
After a few exchanges on the Microsoft Skype for Business MVP's private distribution list, it appears that attendees have to be part of the organization or otherwise the call will fail.
Submitted a Pull Request to update the latest version of the documentation

Twilio StatusCallBack Incorrect

I'm developing a vb net application using twilio api.
This is my code:
Twilio.TwilioClient.Init(AccountSid, AuthToken)
Dim call_to As PhoneNumber = New PhoneNumber("...")
Dim call_from As PhoneNumber = New PhoneNumber("...")
Dim call_option As CreateCallOptions = New CreateCallOptions(call_to, call_from)
call_option.Method = "Get"
call_option.Timeout = 25
call_option.Url = New Uri(ws_url & "/GET_CALL_XML" & ws_parameter)
call_option.StatusCallback = New Uri(ws_url & "/GET_CALL_FEEDBACK" & ws_parameter)
call_option.FallbackUrl = New Uri(ws_url & "/GET_CALL_ERROR" & ws_parameter)
call_option.StatusCallbackEvent.Add("answered")
call_option.StatusCallbackEvent.Add("completed")
Dim call_ As CallResource = CallResource.Create(call_option)
The call is successfully performed.
Now the problem is:
if the user answer the call, i receive the StatusCallBack with "callstatus"="in-progress"
if the user refuse the call, i receive the StatusCallBack with "callstatus"="in-progress" equally
How can i know if the user really answer the call?
Thank you
Twilio developer evangelist here.
If the user actually answers the call, then you will get a webhook to the Url that you set, in your example, the one with the path /GET_CALL_XML.
If the user refuses the call then you will not receive a webhook to that URL.

Retrieve & hold call in twilio

I put the twilio call on hold by following snippet
var twilio = new TwilioRestClient(Settings.AccountSid, Settings.AuthToken);
twilio.RedirectCall(callSid, Settings.HoldMusic, "GET");
But i want to retrieve the holded call back.. Can you please any one help me with code snippet
It sounds to me like what you'd like to achieve is tracking the status of a call that is on hold as described in this FAQ.
You can use the StatusCallbackEvent parameter on outbound calls made via the REST API. If you're indeed using the C# helper library it would look something like this:
var options = new CallOptions();
options.Url = "http://demo.twilio.com/docs/voice.xml";
options.From = "+18668675309";
options.Method = "GET";
options.StatusCallback = "https://www.myapp.com/events";
options.StatusCallbackMethod = "POST";
options.StatusCallbackEvents = new string[] { "initiated", "ringing", "answered", "completed" };
Also, depending on your use case, there is now a dedicated Hold feature available when using <Conference> as detailed in this post.

Add event to Google Calendar via API v3 using OAuth 2.0 service account?

I am getting a forbidden (403) when trying to add an event to my calendar (API v3 & OAuth2), as follows:
var service = CalendarService();
CalendarListResource.ListRequest request = service.CalendarList.List();
IList<CalendarListEntry> calendarList = request.Execute().Items;
foreach (CalendarListEntry entry in calendarList)
{
Console.WriteLine(
"Summary:{0}\nLocation:{1}\nTimeZone:{2}",
entry.Summary, entry.Location, entry.TimeZone
);
}
var startDate = DateTime.Now.AddDays(1);
var endDate = startDate.AddDays(1);
var eventBody = new Google.Apis.Calendar.v3.Data.Event
{
Description = "Test 4 description",
Summary = "Test 4 summary",
Start = new EventDateTime
{
DateTime = startDate
},
End = new EventDateTime
{
DateTime = endDate
}
};
var insertRequest = service.Events.Insert(calendarId: calendarId_emailAddress, body: eventBody); //InsertRequest
insertRequest.Execute();
I have set up oauth2 service account, granted scopes, and shared the calendar. However, something I noticed on the calendar share part is that I am unable (no option available) to share for read/write. Only option is "freeBusyRead".
EDIT:
Let me add that calendarId_emailAddress = "my_email_address". I was able to add an event. No errors. And then iterate and find it. But it does not show up in my calendar. I seem to not be making the connection between the calendarId and the "actual calendar" in my user panel.
So how to do this. Any help appreciated. Thanks.
Your Google Apps domain probably limits the level of sharing to external accounts to free/busy only. Service accounts, even when created by a domain user, are always considered external to the domain.
The proper way to do this would be to authorize the service account to act on behalf of your domain users and then, authenticating as the service account and acting on behalf of the user, add the event to the user calendar. Domain-wide delegation of authority is discussed in the Drive API docs but can easily be applied to Calendar API also.
The trouble was in the authentication of the service. Scenarios...
1) ServiceAccountCredential with no user set, and calendarId = "primary" yields an entry into calendar. Which calendar? Who knows. I can't see the entry in my interface of that user, but I do find the entry in the Events.List("primary")
2) ServiceAccountCredential with user set to email of target calendar, and calendarId = "primary" yields an entry into calendar, which I do see in my interface of that user, and also find the entry in the Events.List("primary")
Scenario #1 really baffles me. No idea how to see that event in the calendar.
Any insight into this would be helpful. Thanks!

Error when trying to get Purchases from Android Publisher Service in a .Net Web API

I have a web Api, which needs to validate purchases from Play Store. According to what I read in the google api documentation, I need to have a service account, and use its credentials to be authenticated, to be able to do what i want.
I have the following code:
String serviceAccountEmail = "MYSERVICEACCOUNTEMAIL#developer.gserviceaccount.com";
var certificate = new X509Certificate2(#"C:\privatekey.p12", "notasecret", X509KeyStorageFlags.Exportable);
ServiceAccountCredential credential = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(serviceAccountEmail)
{
Scopes = new[] { "https://www.googleapis.com/auth/androidpublisher" }
}.FromCertificate(certificate));
// Create the service.
var service = new AndroidPublisherService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential
});
var data = service.Purchases.Get("MYPACKAGE", "MYPRODUCT",
"MYTOKEN")
.Execute();
It throws the following exception
Google.Apis.Requests.RequestError
Invalid Value [400]
Errors [
Message[Invalid Value] Location[ - ] Reason[invalid] Domain[global]
]
I have NO IDEA of what can be causing it. I searched a lot, but I didn't find something really helpful. Any kind help will be really appreciated.
I know this question is "a little" old, but I still want to try to answer for clarification.
var data = service.Purchases.Get("MYPACKAGE", "MYPRODUCT",
"MYTOKEN")
.Execute();
My guess would be that this part is not entirely right. The Purchases class does not have a Get method. Before that you have to specify either (in your case):
service.Purchases.Products.Get(...) -> for consumable products
service.Purchases.Subscriptions.Get(...) -> for subscriptions
This answer assumes you are using V2. Hope it helps anyone who is stuck.

Resources