Пример #1
0
        public IHttpActionResult DeleteWebhook(string id, [FromUri] string token, [FromUri] string shopname)
        {
            var service = new ShopifyService();
            var webhooks = service.DeleteEntity("webhooks", token, shopname, id);

            return Ok(webhooks);
        }
Пример #2
0
        public IHttpActionResult GetCollections([FromUri] string token, [FromUri] string shopname,
            [FromUri] string[] fields, [FromUri] int top = 0)
        {
            var service = new ShopifyService();
            var collections = service.GetEntities("custom_collections", token, shopname, fields, top, null);

            return Ok(collections);
        }
Пример #3
0
        public IHttpActionResult GetCollection(string id, [FromUri] string token, [FromUri] string shopname,
            [FromUri] string[] fields, [FromUri] int top = 0)
        {
            var service = new ShopifyService();
            var collection = service.GetEntity("collections", id, token, shopname, fields, top);

            return Ok(collection);
        }
Пример #4
0
        public IHttpActionResult GetAccessToken([FromUri] string code, [FromUri] string shop)
        {
            var shopName = shop.Replace(".myshopify.com", "");
            var service = new ShopifyService();
            var token = service.GetAccessToken(code, shopName);

            return Ok(token); // Returns 401 if our App is'nt installed or the Token is invalid
        }
Пример #5
0
        public IHttpActionResult CreateWebhook([FromBody]JObject webhook, [FromUri] string token,
            [FromUri] string shopname)
        {
            var service = new ShopifyService();
            var webhooks = service.CreateEntity("webhooks", token, shopname, webhook);

            return Ok(webhooks);
        }
Пример #6
0
        public IHttpActionResult GetCustomer(string id, [FromUri] string token, [FromUri] string shopname,
            [FromUri] string[] fields, [FromUri] int top = 0)
        {
            var service = new ShopifyService();
            var customer = service.GetEntity("customers", id, token, shopname, fields, top);

            return Ok(customer);
        }
Пример #7
0
        public IHttpActionResult Login(string shopname)
        {
            var loginUrl = new ShopifyService().GetLoginUrl(shopname);

            return Redirect(loginUrl);
        }
Пример #8
0
        public IHttpActionResult GetWebhooks([FromUri] string token, [FromUri] string shopname,
            [FromUri] string[] fields, [FromUri] int top = 0)
        {
            var service = new ShopifyService();
            var webhooks = service.GetEntities("webhooks", token, shopname, fields, top, null);

            return Ok(webhooks);
        }
Пример #9
0
        public IHttpActionResult GetProducts([FromUri] string token, [FromUri] string shopname,
            [FromUri] string[] fields, [FromUri] int top = 0)
        {
            var service = new ShopifyService();
            var products = service.GetEntities("products", token, shopname, fields, top, null);

            return Ok(products);
        }
Пример #10
0
        public IHttpActionResult GetProduct(string id, [FromUri] string token, [FromUri] string shopname,
            [FromUri] string[] fields, [FromUri] int top = 0)
        {
            var service = new ShopifyService();
            var product = service.GetEntity("products", id, token, shopname, fields, top);

            return Ok(product);
        }
Пример #11
0
        public IHttpActionResult GetFilters([FromUri] string token, [FromUri] string shopname, [FromUri] string[] fields,
            [FromUri] int top = 0)
        {
            var service = new ShopifyService();
            var filters = service.GetEntities("customer_saved_searches", token, shopname, fields, top, null);

            return Ok(filters);
        }