Update Prescription for Pet
1 min
code examples curl request patch \\ \ url https //developer digitail io/api/v1/pets/{id}/prescriptions/{prescription} \\ \ header 'accept application/json'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var requestoptions = { method 'patch', headers myheaders, redirect 'follow' }; fetch("https //developer digitail io/api/v1/pets/{id}/prescriptions/{prescription}", 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}/prescriptions/{prescription}") https = net http new(url host, url port) https use ssl = true request = net http patch 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}/prescriptions/{prescription}" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("patch", url, headers=headers, data=payload) print(response text) responses // successful operation { "data" { "id" 1, "record id" 1, "clinic id" 1, "vet id" 1, "pet id" 1, "product id" 1, "product name" "product name", "type" 0, "quantity" 1, "unit id" 1, "unit" "unit", "label" "administer 1 tablet by mouth every 12 hours for 7 days", "prescribed at" "2020 01 01t00 00 00z", "expires at" "2020 01 01t00 00 00z", "status" "active", "delivery status" "complete", "delivery provider" "vetsource", "internal notes" "internal notes", "product ext id" "", "prescription ext id" "", "order ext id" "", "refills received" 1, "max refills" 3, "last refill at" "2020 01 01t00 00 00z", "refills" \[ { "id" 1, "prescription id" 1, "record id" 1, "vet id" 1, "type" 0, "label" "refill", "refilled at" "2020 01 01t00 00 00 000z", "is initial" false, "number" 1, "internal notes" "internal notes" } ], "created at" "2022 02 06t22 00 00 000000z", "updated at" "2022 02 06t22 00 00 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 is not authorized to perform the requested operation // this response is sent when a request fails validation the format is identical on all endpoints { "message" "the name field is required (and 1 more error)", "errors" { "field1" \[ "" ], "field2" \[ "" ] } }// the user has sent too many requests in a given amount of time ("rate limiting") max 200 requests per minute