Esempio n. 1
0
        public static async Task <NodeNotificationResponse> EnrollPostNotificationExample(int telematicsNode, PostRequest postRequest)
        {
            TelematicsV2             telematicsV2 = new TelematicsV2(publicKey, privateKey, userKey);
            NodeNotificationResponse response     = await telematicsV2.EnrollPostNotification(telematicsNode, postRequest);

            return(response);
        }
Esempio n. 2
0
        public static async Task <NodeNotificationResponse> GetNotificationUserForNodeExample(int nodeId)
        {
            TelematicsV2             telematicsV2 = new TelematicsV2(publicKey, privateKey, userKey);
            NodeNotificationResponse response     = await telematicsV2.GetNotificationUserForNode(nodeId);

            return(response);
        }
Esempio n. 3
0
        public static async Task <NodeNotificationResponse> EnrollSnsNotificationExample(int telematicsNode, SNSRequest snsRequest)
        {
            TelematicsV2             telematicsV2 = new TelematicsV2(publicKey, privateKey, userKey);
            NodeNotificationResponse response     = await telematicsV2.PostNotificationEnrollmentSns(telematicsNode, snsRequest);

            return(response);
        }
        /// <summary>
        /// The GET TelematicsNodeV2/Notifications/{nodeId} endpoint retrieves all enrolled notifications for a single telematics node for all api partner users.
        /// </summary>
        /// <param name="nodeId"></param>
        /// <returns></returns>
        public async Task <NodeNotificationResponse> GetNotificationForApiPartnerByNode(int nodeId)
        {
            Dictionary <string, string> headers = ApiUtilities.BuildHeaders(UserKey, PublicKey, PrivateKey, $"telematicsnodev2/notifications/{nodeId}");

            HttpResponseMessage response = await Api.Get($"telematicsnodev2/notifications/{nodeId}", headers);

            NodeNotificationResponse result = await Api.DeserializeContent <NodeNotificationResponse>(response);

            return(result);
        }
        /// <summary>
        /// The POST TelematicsNodeV2/Notifications/{telematicsNodeID}/Post endpoint enrolls the Telematics Node for POST notifications, notifications will be sent to the designated POST URI.
        /// Api partners with FDA permissions can include an FDA Configuration in the request to have the notification converted to a specified output preference.
        /// </summary>
        /// <param name="nodeId"></param>
        /// <param name="postNotificationRequest"></param>
        /// <returns></returns>
        public async Task <NodeNotificationResponse> EnrollPostNotification(int nodeId, PostRequest postNotificationRequest)
        {
            Dictionary <string, string> headers = ApiUtilities.BuildHeaders(UserKey, PublicKey, PrivateKey, $"telematicsnodev2/notifications/{nodeId}/post", "POST");

            string json = JsonConvert.SerializeObject(postNotificationRequest);

            StringContent content = new StringContent(json, Encoding.UTF8, "application/json");

            HttpResponseMessage response = await Api.Post($"telematicsnodev2/notifications/{nodeId}/Post", headers, content);

            NodeNotificationResponse result = await Api.DeserializeContent <NodeNotificationResponse>(response);

            return(result);
        }