List clinic plans by clinic slug
1 min
code examples curl request get \\ \ url 'https //developer digitail io/api/v1/public/clinics/{slug}/plans?page=1\&per page=15' \\ \ header 'accept application/json'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var requestoptions = { method 'get', headers myheaders, redirect 'follow' }; fetch("https //developer digitail io/api/v1/public/clinics/{slug}/plans?page=1\&per page=15", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //developer digitail io/api/v1/public/clinics/{slug}/plans?page=1\&per page=15") https = net http new(url host, url port) https use ssl = true request = net http get new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" response = https request(request) puts response read body import requests import json url = "https //developer digitail io/api/v1/public/clinics/{slug}/plans?page=1\&per page=15" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("get", url, headers=headers, data=payload) print(response text) responses // successful operation { "data" \[ { "id" 1, "clinic id" 1, "name" "basic", "description" "basic subscription plan", "price" 10, "price without tax" 10, "tax" 0, "upfront fee" 0, "upfront fee without tax" 0, "periodicity" 1, "periodicity type" "", "plan duration" "", "benefits" { "services" \[ { "id" 1, "service package id" 1, "limit" 1, "discount" 0 } ], "service aaha codes" \[ { "id" 1, "aaha code" "aha123", "discount" 0, "limit" 1 } ], "products" \[ { "id" 1, "product id" 1, "limit" 1, "limit unit type id" 0, "limit unit type" "subunit", "discount" 0 } ], "product categories" \[ { "id" 1, "product category id" 1, "discount" 0 } ], "product aaha codes" \[ { "id" 1, "aaha code" "aha123", "discount" 0, "limit" 1, "limit unit type id" 0 } ] } } ], "links" {}, "meta" {} }// the request was invalid or contained data that was not allowed { "message" "requested filter(s) `filter1` are not allowed allowed filter(s) are date, query, " }// the user has sent too many requests in a given amount of time ("rate limiting") max 200 requests per minute