Can someone spot what is wrong? the callback url is a valid ssl url. Also how do we know if google service itself is having issues? I don't yet see posts to my callback url at all on my web server logs..
I don't seem to be getting notifications back.
StoredCredentialsDBContext db = new StoredCredentialsDBContext();
TimelineItem item = new TimelineItem()
{
Creator=new Contact(){DisplayName="DLN Reply Card",Id="TESTREPLYCARD" },
Title = Test Number",
Text = "Say Test Number",
Notification = new NotificationConfig() { Level = "DEFAULT" }
};
Google.Apis.Mirror.v1.Data.MenuItem menuItem=new Google.Apis.Mirror.v1.Data.MenuItem();
menuItem.Action="REPLY";
item.MenuItems = new List<Google.Apis.Mirror.v1.Data.MenuItem>();
item.MenuItems.Add(menuItem);
foreach (StoredCredentials creds in db.StoredCredentialSet)
{
AuthorizationState state = new AuthorizationState()
{
AccessToken = creds.AccessToken,
RefreshToken = creds.RefreshToken
};
MirrorService service = new MirrorService(new BaseClientService.Initializer()
{
Authenticator = Utils.GetAuthenticatorFromState(state)
});
item.IsPinned = true;
Subscription subscription = new Subscription();
subscription.Collection = "timeline";
subscription.VerifyToken = "XXXXX";
subscription.UserToken = creds.UserId;
subscription.Operation = new List<String>();
subscription.Operation.Add("INSERT");
subscription.Operation.Add("UPDATE");
subscription.CallbackUrl = "https://changedthename.com/GG/Notify";
Subscription t=service.Subscriptions.Insert(subscription).Fetch();
TimelineItem i=service.Timeline.Insert(item).Fetch();
SubscriptionsListResponse r= service.Subscriptions.List().Fetch();
}
The output of executing Fetch() which is subscription object (I just hid the domain name):
?t
{Google.Apis.Mirror.v1.Data.Subscription}
CallbackUrl: "https://changedname.com/GG/Notify"
Collection: "timeline"
ETag: null
Id: "timeline"
Kind: "mirror#subscription"
Notification: null
Operation: Count = 2
Updated: "2014-02-06T16:59:25.642Z"
UserToken: "XXXXXXXXXX"
VerifyToken: "XXXXX"
Item I used:
?i
{Google.Apis.Mirror.v1.Data.TimelineItem}
Attachments: null
BundleId: null
CanonicalUrl: null
Created: "2014-02-06T16:59:32.729Z"
Creator: {Google.Apis.Mirror.v1.Data.Contact}
DisplayTime: null
ETag: "1391705972729"
Html: null
HtmlPages: null
Id: "73b75493-3371-4b2c-856d-df8674b54ede"
InReplyTo: null
IsBundleCover: null
IsDeleted: null
IsPinned: false
Kind: "mirror#timelineItem"
Location: null
MenuItems: Count = 1
Notification: {Google.Apis.Mirror.v1.Data.NotificationConfig}
PinScore: null
Recipients: null
SelfLink: "https://www.googleapis.com/mirror/v1/timeline/73b75493-3371-4b2c-856d-df8674b54ede"
SourceItemId: null
SpeakableText: null
Text: "Say Test Number"
Title: "Test Number"
Updated: "2014-02-06T16:59:32.729Z"
?r
{Google.Apis.Mirror.v1.Data.SubscriptionsListResponse}
ETag: null
Items: Count = 1
Kind: "mirror#subscriptionsList"
My Test payload for my callback url using SOapui
Post req with following payload
{
"collection": "timeline",
"itemId": "d45fcc3a-4346-453a-8783-88667a002387",
"operation": "UPDATE",
"userToken": "XXXXXXX",
"verifyToken": "XXXXX",
"userActions": [
{
"type": "<TYPE>",
"payload": "<PAYLOAD>"
}
]
}
200 ok response back from soapui
HTTP/1.1 200 OK
Cache-Control: private
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 3.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 04 Feb 2014 17:48:47 GMT
Content-Length: 0