Digitail API
Prescriptions

Update Refill for Prescription

1min
code examples curl location globoff request patch 'https //developer digitail io/api/v1/prescriptions/{id}/refills/{refill}' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "vet id" "" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "vet id" "" }); var requestoptions = { method 'patch', headers myheaders, body raw, redirect 'follow' }; fetch("https //developer digitail io/api/v1/prescriptions/{id}/refills/{refill}", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));import requests import json url = "https //developer digitail io/api/v1/prescriptions/{id}/refills/{refill}" payload = json dumps({ "vet id" "" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("patch", url, headers=headers, data=payload) print(response text) \<?php $curl = curl init(); curl setopt array($curl, array( curlopt url => 'https //developer digitail io/api/v1/prescriptions/{id}/refills/{refill}', curlopt returntransfer => true, curlopt encoding => '', curlopt maxredirs => 10, curlopt timeout => 0, curlopt followlocation => true, curlopt http version => curl http version 1 1, curlopt customrequest => 'patch', curlopt postfields =>'{ "vet id" "" }', curlopt httpheader => array( 'accept application/json', 'content type application/json' ), )); $response = curl exec($curl); curl close($curl); echo $response; responses // successful operation { "data" { "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" } }// 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