List all Medications for Pet
1 min
code examples curl request get \\ \ url https //developer digitail io/api/v1/pets/{id}/medications \\ \ 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/pets/{id}/medications", 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/pets/{id}/medications") 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/pets/{id}/medications" 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" { "dietstatus" \[ { "id" 1, "pet id" 1, "file id" 1, "product id" 1, "treatment mapping id" 1, "filecase" { "id" 1, "number" "175", "status" 1, "vet id" 1, "responsible id" 1, "responsible" {}, "clinic id" 1, "pet id" 1, "sale id" 1, "date" "2021 11 19", "reason" "routine checkup", "template id" 0, "comments" "", "recommendations" "", "rabic tag number" "", "presumptive diagnosis" "", "diagnosis" "", "treatment" "", "visit types" \[ "" ], "reason visit type" {}, "structure" {}, "selecteddiagnoses" \[ { "id" 1, "name" "otitis externa", "description" "", "recommendation" "", "clinic id" 1 } ], "clinical examination notes" "" }, "treatment" { "id" 1, "type" "treatment", "product name" "nobivac rabies", "tag number" "123456789", "batch no" "tr22", "expiration date" "2022 01 01", "product manufacturer" "", "administration date" "2021 11 19", "due date" "2022 11 19", "product category id" 1 }, "certificates" \[ { "id" 9, "name" "", "title" "rabies certificate for daisy", "real name" "rabies certificate for daisy pdf", "printable file id" "1086", "vet id" "1568", "patient id" "316635", "pet id" "316635", "token" "", "notified at" "2021 11 19t13 40 23 000000z", "signed at" "2021 11 19t13 40 23 000000z", "confirmed at" "2021 11 19t13 40 23 000000z", "has signature shortcode" false, "has fillable inputs" false, "type" "", "created at" "2021 11 19t13 40 23 000000z" } ] } ] } }// 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 authorization token is missing or invalid // the user has sent too many requests in a given amount of time ("rate limiting") max 200 requests per minute