Customer Portal Integration Guide

Red Hat Customer Portal 1

Guidance for integrating your application with the Red Hat Customer Portal

Red Hat, Inc

Abstract

This document provides information about using APIs exposed by the Red Hat Customer Portal in order to query and update customer cases.

1. Introduction

It is now possible to integrate with the Customer Portal at http://access.redhat.com using an XML-based REST API [1]. This document outlines common use cases including examples in common clients and frameworks. The official API documentation can be found on the Customer Portal at https://access.redhat.com/site/documentation/Red_Hat_Customer_Portal/ and includes both XML Schema and RESTful resource information.

2. Clients

The Customer Portal API is, by nature, client-agnostic. It is expressed as a set of resource URLs which send and receive XML data. Some common clients and platforms include, but are not limited to, the following:
Client
Platform/Environment
Comments
cURL [a]
Command Line (Linux, UNIX, Mac OS X, Microsoft Windows)
Easy and transparent way to test commands and do simple integration
Apache HTTP Client [b]
Java
Most common Java library with which to talk HTTP; offers little semantic value beyond simple HTTP; no intrinsic binding of XML
RESTeasy Client [c]
Java
Full Java model integration; no need to think about HTTP or XML; uses Apache HTTP Client underneath

3. Common Usage

For clarity, this document includes cURL examples for all use cases and includes examples using other frameworks as a courtesy from Red Hat. cURL most clearly illustrates the nature of interacting with RESTful resources. Authentication code is omitted from all examples. When using cURL, the -u username switch is expected. For more information, see the man page for cURL by using the command man curl.

4. Examples

Example 1. List Cases

This example returns all cases from the logged-in user's account.
$ curl https://api.access.redhat.com/rs/cases

Example 2. Filter by last update date

$ curl https://api.access.redhat.com/rs/cases?startDate=2010-01-01&endDate=2010-12-31

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 https://api.access.redhat.com/rs/cases/0000000/comments

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/xml' --data

  '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

   <case xmlns="http://www.redhat.com/gss/strata">

     <summary>Example Case</summary>

     <description>Example created with cURL</description>

     <product>Red Hat Enterprise Linux</product><version>6.0</version>

   </case>'

  https://api.access.redhat.com/rs/cases

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 GFS.
$ curl -X PUT -H 'Content-Type: application/xml' --data

  '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

   <case xmlns="http://www.redhat.com/gss/strata">

     <product>GFS</product><version>6.0</version>

   </case>'

  https://api.access.redhat.com/rs/cases/0000000

Example 6. Escalate a Case for Management Attention

This will escalate a case for management attention:

$ curl -X PUT -H 'Content-Type: application/xml' --data

  '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

   <case xmlns="http://www.redhat.com/gss/strata">

     <escalated>true</escalated>

   </case>'

  https://api.access.redhat.com/rs/cases/0000000

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/xml' --data

  '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

   <comment xmlns="http://www.redhat.com/gss/strata">

     <text>Test comment!  This can contain lots of information, etc.</text>

   </comment>'

  https://api.access.redhat.com/rs/cases/0000000/comments

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.
$ curl -X POST -F 'file=@test.txt' https://api.access.redhat.com/rs/cases/0000000/attachments

A. Revision History

Revision History
Revision 2.0-1.4002013-12-18Rüdiger Landmann
Rebuild with publican 4.0.0
Revision 2.0-1Fri Nov 1 2013Zac Dover
Publish for new site
Revision 0.0-0Tue Sep 24 2013Misty Stanley-Jones
Converted existing document to Docbook

Legal Notice

Copyright © 2013 Red Hat, Inc..
This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.