Ce contenu n'est pas disponible dans la langue sélectionnée.
5. Examples
Example 1. List Cases
$ curl -X POST -H ‘Content-Type: application/json’ -H ‘Authorization: Bearer $token’ --data ‘{ "offset" : 1, "maxResults": 10 }’ https://api.access.redhat.com/support/v1/cases/filter
Example 2. Filter by last update date
$ curl -X POST -H ‘Content-Type: application/json’ -H ‘Authorization: Bearer $token’ --data ‘{ “startDate” : “2021-01-01”, “endDate”: “2021-12-31” }’ https://api.access.redhat.com/support/v1/cases/filter
Example 3. List Case Comments
0000000
with the number of a case to which you have access.
$ curl -H ‘Authorization: Bearer $token’ https://api.access.redhat.com/support/v1/cases/0000000/comments
Example 4. Create a Case
RHEL 6
product using the default group, severity level, and type.
$ curl -X POST -H 'Content-Type: application/json -H ‘Authorization: Bearer $token’ --data '{ "product":"Red Hat Enterprise Linux", "version":"7.0", "summary": "Example Case", "description": "Example Case created with cURL” }' https://api.access.redhat.com/support/v1/cases
Example 5. Update a Case
$ curl -X PUT -H 'Content-Type: application/json -H ‘Authorization: Bearer $token’ --data '{ "product": “Red Hat Enterprise Linux”, "version":"7.0" }' https://api.access.redhat.com/support/v1/cases/0000000
Example 6. Escalate a Case for Management Attention
$ curl -X PUT -H 'Content-Type: application/json -H ‘Authorization: Bearer $token’ --data '{ "requestManagementEscalation": true }' https://api.access.redhat.com/support/v1/cases/0000000
Example 7. Add a New Case Comment
$ curl -X POST -H 'Content-Type: application/json -H ‘Authorization: Bearer $token’ --data '{ “commentBody”: “Test comment! This can contain lots of information, etc.” }' https://api.access.redhat.com/support/v1/cases/0000000/comments
Example 8. Add a File Attachment to a Case
test.txt
to case 0000000. API supports file upload till 1GB.
$ curl -X POST -F 'file=@test.txt' -H ‘Authorization: Bearer $token’ https://api.access.redhat.com/support/v1/cases/0000000/attachments