Example #1
0
        /// <summary>
        /// Creates a new subscription with bearer token authentication
        /// </summary>
        /// <param name="publishToUrl">URL to receive HTTP post</param>
        /// <param name="bearerToken">The bearer token</param>
        /// <param name="vehicleId">Optional if you want only to subscribe to a specific vehicle</param>
        /// <returns></returns>
        public PublishSubscribeModel CreatePublishSubscribe(string publishToUrl, PublishSubscribeAuthenticationData_Bearer bearerToken, int?vehicleId = null)
        {
            PublishSubscribeCreateModel model = CreatePublishSubscribeCreateModel(publishToUrl, ApiPublishSubscribeAuthenticationType.BearerToken, vehicleId);

            model.AuthenticationData = Newtonsoft.Json.JsonConvert.SerializeObject(bearerToken);
            return(CreatePublishSubscribe(model));
        }
Example #2
0
        /// <summary>
        /// Creates a new subscription with bearer token authentication
        /// </summary>
        /// <param name="publishToUrl">URL to receive HTTP post</param>
        /// <param name="bearerToken">The bearer token</param>
        /// <param name="vehicleId">Optional if you want only to subscribe to a specific vehicle</param>
        /// <returns></returns>
        public void EditPublishSubscribe(int publishSubscribeId, string publishToUrl, PublishSubscribeAuthenticationData_Bearer bearerToken, int?vehicleId = null)
        {
            PublishSubscribeEditModel model = CreatePublishSubscribeEditModel(publishToUrl, ApiPublishSubscribeAuthenticationType.BearerToken, vehicleId);

            model.AuthenticationData = Newtonsoft.Json.JsonConvert.SerializeObject(bearerToken);
            EditPublishSubscribe(publishSubscribeId, model);
        }