<turbo-stream action="update" target="wiki_card"><template>

<h1>REST API Data Errors - Delete Data Errors</h1>
<div class="trix-content"><p>If you want to delete one or more data errors, please see below for both JSON and JSONAPI examples.</p><p>NOTE: Remember to substitute the token (after Bearer) and the service id (the "xyz" below) to your own token and service id.<br><br></p><h1><strong>Deleting a single Data Error:</strong></h1><p><br></p><p><strong>JSON:</strong></p><pre>curl -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MDE2ODg3NTMsInN1YiI6MX0.oLh_7lsktvX4NP-6Dh4ptGKZe6JEfzeMIgzDjRpMyHM"<br>-H "Content-Type: application/json"<br>-H "Accept: application/json"<br>-X DELETE<br>http://staging.myrapidi.com/api/v2/service/xyz/data_errors/4</pre><p><br></p><p><strong>JSONAPI:</strong></p><pre>curl -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MDE2ODg3NTMsInN1YiI6MX0.oLh_7lsktvX4NP-6Dh4ptGKZe6JEfzeMIgzDjRpMyHM"<br>-H "Content-Type: application/vnd.api+json"<br>-H "Accept: application/vnd.api+json"<br>-X DELETE<br>http://staging.myrapidi.com/api/v2/service/xyz/data_errors/4</pre><p><br></p><p>The output for both JSON and JSONAPI on successful deletion is the response code <strong>Status: 204 No Content</strong>.</p><p>For both JSON and JSONAPI the output when your deletion has failed (ex. Data Error has already been deleted) is the response code <strong>Status: 404 Not Found</strong> + an error message<br><br></p><p>Example if the given Data Error ID does not exist:<br><br></p><pre>{<br>&nbsp; &nbsp; "errors": [<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "source": {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "pointer": "/data/attributes/id"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "detail": "not found - could not find Error Log with id 4"<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; ]<br>}</pre><p><br><br></p><h1><strong>Deleting all/multiple Data Error entries:</strong></h1><p><br></p><h2><strong>To delete all data errors belonging to your service:</strong></h2><p><br></p><p><strong>JSON:</strong></p><pre>curl -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MDE2ODg3NTMsInN1YiI6MX0.oLh_7lsktvX4NP-6Dh4ptGKZe6JEfzeMIgzDjRpMyHM"<br>-H "Content-Type: application/json"<br>-H "Accept: application/json"<br>-X POST<br>http://staging.myrapidi.com/api/v2/service/xyz/data_errors/delete_all</pre><p><br></p><p><strong>JSONAPI:</strong></p><pre>curl -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MDE2ODg3NTMsInN1YiI6MX0.oLh_7lsktvX4NP-6Dh4ptGKZe6JEfzeMIgzDjRpMyHM"<br>-H "Content-Type: application/vnd.api+json"<br>-H "Accept: application/vnd.api+json"<br>-X POST<br>http://staging.myrapidi.com/api/v2/service/xyz/data_errors/delete_all</pre><p><br></p><p>The output for both JSON and JSONAPI on successful deletion is the response code <strong>Status: 204 No Content</strong>.<br><br></p><h2><strong>To delete a specific set of data errors:</strong></h2><p><br><strong>JSON:</strong></p><pre>curl -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MDE2ODg3NTMsInN1YiI6MX0.oLh_7lsktvX4NP-6Dh4ptGKZe6JEfzeMIgzDjRpMyHM"<br>-H "Content-Type: application/json"<br>-H "Accept: application/json"<br>-X POST<br>http://staging.myrapidi.com/api/v2/service/xyz/data_errors/delete_all?ids=1,2,3,4,7</pre><p><br></p><p><strong>JSONAPI:</strong></p><pre>curl -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MDE2ODg3NTMsInN1YiI6MX0.oLh_7lsktvX4NP-6Dh4ptGKZe6JEfzeMIgzDjRpMyHM"<br>-H "Content-Type: application/vnd.api+json"<br>-H "Accept: application/vnd.api+json"<br>-X POST<br>http://staging.myrapidi.com/api/v2/service/xyz/data_errors/delete_all?ids=1,2,3,4,7</pre><p><br></p><p>The output for both JSON and JSONAPI on successful deletion is the response code <strong>Status: 204 No Content</strong>.<br><br></p><p>There is no error condition for the ids-based deletion method, as it filters out invalid ids.<br><br></p></div>
</template></turbo-stream>

