Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

5. Examples


The following examples demonstrate how to pass the authentication token through a bearer header using cURL.

Example 1. List Cases

Return 10 cases from the logged-in user's account
$ 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
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

Example 3. List Case Comments

This example lists case comments for case 0000000.
Replace 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
Copy to Clipboard Toggle word wrap

Example 4. Create a Case

The POST operation is used in this example, which creates a case under the 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
Copy to Clipboard Toggle word wrap

Example 5. Update a Case

The PUT method is used here to update data on an existing case. Most fields can be updated in this way.
Case 000000's product is changed to Red Hat Enterprise Linux.
$ 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
Copy to Clipboard Toggle word wrap

Example 6. Escalate a Case for Management Attention

This will 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
Copy to Clipboard Toggle word wrap

Example 7. Add a New Case Comment

This example uses the POST method to add a new comment to case 0000000.
$ 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
Copy to Clipboard Toggle word wrap

Example 8. Add a File Attachment to a Case

File attachments are unique because they carry no XML payload. This example uses a form-encoded POST to transmit a file named 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
Copy to Clipboard Toggle word wrap
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat