Esempio n. 1
0
        public async Task<TimelineResult> DeleteUserPin(string userToken, Pin pin)
        {
            if (string.IsNullOrEmpty(userToken)) throw new ArgumentNullException("userToken");
            if (pin == null) throw new ArgumentNullException("pin");

            var request = new TimelineRequest()
            {
                Pin = pin,
                EndPoint = "/v1/user/pins/" + pin.Id,
                Headers = new Dictionary<string, string>()
                {
                    {"X-User-Token", userToken}
                },
                Method = Methods.DELETE
            };
            return await Send(request);
        }
Esempio n. 2
0
        public async Task<TimelineResult> sendSharedPin(IEnumerable<string> topics, Pin pin)
        {
            if (string.IsNullOrEmpty(_apiKey)) throw new ArgumentNullException("ApiKey");
            if (topics == null) throw new ArgumentNullException("topics");
            if (pin == null) throw new ArgumentNullException("pin");

            var request = new TimelineRequest()
            {
                Pin = pin,
                EndPoint = "/v1/shared/pins/" + pin.Id,
                Headers = new Dictionary<string, string>()
                {
                    {"X-API-Key", _apiKey},
                    {"X-PIN-Topics", string.Join(",", topics)},
                },
                Method = Methods.PUT
            };
            return await Send(request);
        }