SupportCenter Plus

    Request Related Operations

     

    While invoking the request related operations through API, the operation defined are based on the parameter value, and the developer needs to submit a request to the url via HTTP POST or GET method.

     

     

    NOTE: Before proceeding with the request related operations and its corresponding parameters, please note that the parameters are case sensitive and should be used as defined.

     


    The following operations can be performed on a request through API,  


     

    Add Request

     

    Through this operation, you can add requests.

     

    URL Format

     

     

    The URL format for the Request operation - Add

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/addRequest

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/addRequest

     

     

     

    Parameters

     

    The parameters that needs to be passed via HTTP method for adding a new request are as follows,

     

     

    Parameter

     

    Value

     

    Description

     
    email

     

    string

     

    Email address of the contact.

     

    product

     

    string

     

    Product for which the request is raised.

     

    status

     

    string

     

    Status of the new request. Generally, the status is Open.

     

    level

     

    string

     

    Denotes the complexity of the new request.

     

    priority

     

    string

     

    Denotes the priority (importance) of the request.   

     

    category

     

    string

     

    Denotes the category of the request.

     

    subCategory

     

    string

     

    Denotes the subcategory of the request.

     

    item

     

    string

     

    Denotes the item of the request.

     

    group

     

    string

     

    Group to which the request was assigned.

     

    supportRep

     

    string

     

    Support Rep assigned to the request.

     

    subject

     

    string

     

    Subject of the new request.

     

    description

     

    string

     

    Description of the new request.

     

    businessUnit

     

    string

     

    Business Unit

     

    UDF Alias Name

     

    string

     

    Name of the UDF field specified while creating the field.

     

    fileContent

     

    string

     

    Pass the File Input Stream of the file

     

    fileName

     

    string

     

    Name of the file to be attached.

     

     

    NOTE:

    1. Please note that the Email and Subject are mandatory fields to be entered while raising a new request. If multi tenancy is enabled through Business Units and if the application has more than one Business Unit configured, then Business Unit becomes a mandatory field.  

    2. For Numeric additional fields, if a non numeric value is provided, then the application will not throw any exception from the server side. Instead, the field will be ignored while adding the request.

    3. Time format can be specified for all Date additional fields. The default time-format will be "dd MM yyyy, HH:mm:ss".

    4. The attachment file size should not exceed the total file size mentioned under the Settings page. If the size exceeds the mentioned value (say, 10 MB), you will receive the following error message: "Error while adding attachment. You can't attach files of size more than 10 MB."

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/addRequest"

     

    status=Success

     

    statuscode=200

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/addRequest"

     

    status=Failure

     

    statuscode=4000

     

    statusmessage=No contact with the specified email exists.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'addRequest' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/addRequest">

    <input type="hidden" name="apikey" value="[SupportCenter API Key]">

    <input type="text" name="email" value="[Email ID of contact]">

    <input type="text" name="subject" value="[Subject of the request]">

    <input type="submit" name="submit" value="submit">

    </form>

     

    You can also add attachments while creating request. For more information, refer "Adding Attachments through API".

     

     

    View/Read Request

     

    URL Format

     

     

    The URL format for the Request operation - View/Read

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getRequest

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getRequest

     

     

     

    Parameters

     

    The parameters that needs to be passed via HTTP method for viewing a request are as follows,

     

     

    Parameter

     

    Value

     

    Description

     

    id

     

    string

     

    Request ID of the request.

     

    search

     

    string

     

    View requests based on keyword search.  

     
    email

     

    string

     

    Email address of the contact.

     

    account

     

    string

     

    Account name of the contact.

     

    product

     

    string

     

    Product for which the request is raised.

     

    productType

     

    string

     

    Product Type of the product.

     

    status

     

    string

     

    Status of the request. Can be Open, Closed, Onhold or any other configured status.

     

    level

     

    string

     

    Denotes the complexity of the request.

     

    priority

     

    string

     

    Denotes the priority (importance) of the request.   

     

    mode

     

    string

     

    Mode through which the request was raised.

     

    group

     

    string

     

    Group to which the request was assigned.

     

    supportRep

     

    string

     

    Support Rep assigned to the request.

     

    subject

     

    string

     

    Subject of the request.

     

    businessUnit

     

    string

     

    Business Unit

     

    createdDuring

     

    today, yesterday, this_week, last_week, this_month, last_month

     

     

    Created date and time of the request.

     

    dueByDuring

     

    today, yesterday, this_week, last_week, this_month, last_month

     

     

    Due by date and time of the request.

     

    completedDuring

     

    today, yesterday, this_week, last_week, this_month, last_month

     

    Completed date and time of the request.

     

    count

     

     

    Denotes the number of requests to be displayed.

     

    countFrom

     

    Denotes the number from which the request should be displayed.

     

    NOTE:

    1. Please note that while performing the 'getRequest' operation, either the Request ID, Email of the contact or name of the Account should be specified. In addition, you can also conduct a search using keywords.

    2. Maximum of 100 requests can be viewed in the list. If the count is not specified, only 10 requests can be viewed in the list.

    3. During ‘getRequest’ operation, all the requests will be retrieved in descending order, with the latest updated request displayed first.

    4. Please note that the date and time fields can be get in the user defined time format. When the support rep executes the 'getRequest' operation, the API key used will check for the date and time format set by the support rep and retrieves the data in the same (user defined) format.

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST or GET method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/getRequest"

     

    status=Success

     

    statuscode=200

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/getRequest"

     

    status=Failure

     

    statuscode=5003

     

    statusmessage=No support rep with specified name exists.

     

     

    Sample Input Form

     

    Sample form for the operation 'getRequest' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getRequest">

    <input type="hidden" name="apikey" value="[SupportCenter API Key]">

    <input type="text" name="email" value="[Email ID of contact]">

    <input type="text" name="status" value="[Status of the request]">

    <input type="submit" name="submit" value="submit">

    </form>

     

    Say, the email ID specified is jake@acme.com and the status as Open. So all the requests by the contact "Jake" with the status as 'Open" is displayed as the output in xml or json.  

     

     

    View/Read Request Description

     

    This operation displays the Request Description alone, by specifying the request ID or by conducting a search using keywords.

     

    URL Format

     

     

    The URL format for the Request operation - View/Read Request Description

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getRequestDescription

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getRequestDescription

     

     

     

    Parameters

     

    Either of the following parameters should be passed via HTTP method.

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request to be viewed.

     

    htmlDescription

     

    True/False

     

    Displays output as html or plain text format. If True, the output is displayed as html format. If False, the output is displayed as a plain text.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST or GET method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/addRequestDescription"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/addRequestDescription"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'addRequestDescription' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/addRequestDescription">

    <input type="hidden" name="apikey" value="[SupportCenter API Key]">

    <input type="text" name="id" value="[Request ID of the request to view/read the description]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    View Request Filters

     

    This operation displays the list of request filters (default and custom filters) available for a user.

     

    URL Format

     

     

    The URL format for the Request operation - View Request Filters

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getRequestFilters

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getRequestFilters

     

     

     

    Parameters

     

    Either of the following parameters should be passed via HTTP method.

     

     

    Parameter

     

    Value

     

    Description

     
    businessUnit

     

    string

     

    Business Unit

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST or GET method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/getRequestFilters"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/getRequestFilters"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=No such Business Unit exists.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'getRequestFilters' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getRequestFilters">

    <input type="hidden" name="apikey" value="[SupportCenter API Key]">

    <input type="text" name="businessUnit" value="[Business Unit]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    View Request based on Filters

     

    Through this operation, you can view all the requests based on the selected filter.

     

    URL Format

     

     

    The URL format for the Request operation - View Request based on Filters

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getRequestsByView

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getRequestsByView

     

     

     

    Parameters

     

    The following parameters need to be passed via HTTP method.

     

     

    Parameter

     

    Value

     

    Description

     

    viewName

     

    string

     

    Name of the Filter.  

     

    businessUnit

     

    string

     

    Business Unit  

     

    count

     

    string

     

    Denotes the number of requests to be displayed. 

     

    countFrom

     

    string

     

    Denotes the number from which the request should be displayed.  

     

    selectColumns

     

    string

     

    Select fields to be displayed as output.

     

    search

     

    string

     

    View requests based on keyword search. For example, if you want to search for a Request ID, give the input as <input type="text" name="search" value="[Request ID:1234]">

     

    NOTE:

    1. Please note that the View Name and Business Units are mandatory fields to be entered.  

    2. For selectColumns fields, you can choose the fields as <input type="text" name="selectColumns" value="[contact, status, subject, dueByTime, created Time]">

    3. Maximum of 100 requests can be viewed in the list. If the count is not specified, only 10 requests can be viewed in the list.

    4. If selectColumns parameter is null, then the following columns such as subject, contact, account, status, priority, supportRep, createdTime, updatedTime, dueByTime, and isOverDue will be taken as default and displayed in the output.

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/getRequestsByView"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/getRequestsByView"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=No such Business Unit exists.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'getRequestByView' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getRequestsByView">

    <input type="hidden" name="apikey" value="[SupportCenter API Key]">

    <input type="text" name="businessUnit" value="[Business Unit]">

    <input type="text" name="viewName" value="[Name of the Filter.]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    Update Request

     

    URL Format

     

     

    The URL format for the Request operation - Update Request

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/updateRequest

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/updateRequest

     

     

     

    Parameters

     

    The parameters that needs to be passed via HTTP method for updating a request are as follows,

     

     

    Parameter

     

    Value

     

    Description

     

    status

     

    string

     

    Status of the request. Can be Open, Closed, Onhold or any other configured status.

     

    group

     

    string

     

    Group to which the request was assigned.

     
    mode

     

    string

     

    Mode through which the request was raised.

     

    level

     

    string

     

    Denotes the complexity of the request.

     

    product

     

    string

     

    Product for which the request is raised.

     

    priority

     

    string

     

    Denotes the priority (importance) of the request.

     

    category

     

    string

     

    Denotes the category of the request.

     

    subCategory

     

    string

     

    Denotes the subcategory of the request.

     

    item

     

    string

     

    Denotes the item of the request.

     

    supportRep

     

    string

     

    Support Rep assigned to the request.

     

    createdDate

     

    string

     

    Created date of the request.

     

    dueByDate

     

    string

     

    Due by date of the request.

     

    FRdueByDate

     

    string

     

    First response due by date of the request.

     

    UDF Alias Name

     

    string/numeric

     

    Name of the UDF field specified while creating the field.

     

    subject

     

    string

     

    Subject of the request.

     

    description

     

    string

     

    Description of the request.

     

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST or GET method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/updateRequest"

     

    status=Success

     

    statuscode=200

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application or if the user does not have permission to update. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/updateRequest"

     

    status=Failure

     

    statuscode=5003

     

    statusmessage=Permission denied.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'updateRequest' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/updateRequest">

    <input type="hidden" name="apikey" value="[SupportCenter API Key]">

    <input type="text" name="id" value="[Request ID of the request]">

    <input type="text" name="status" value="[Status of the request]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    Assign Request

     

    URL Format

     

     

    The URL format for the Request operation - Assign Request

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/assignRequest

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/assignRequest

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request.

     
    supportRep

     

    string

     

    Support rep to whom the request is assigned.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/assignRequest"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application or if the user does not have permission to update. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/assignRequest"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'assignRequest' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/assignRequest">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Request ID of the request]">

    <input type="text" name="supportRep" value="[Support Rep]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    Add Note

     

    Through this operation, you can add notes to the existing requests.

     

    URL Format

     

     

    The URL format for the Request operation - Add Note

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/addRequestNote

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/addRequestNote

     

     

     

    Parameters

     

    The following parameters need to be passed via HTTP method.

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request.

     

    comment

     

    string

     

    Note description added to the request.  

     

    isPublic

     

     

    True/False

     

    If True, the note can be viewed by all users (public). If false, the note can be viewed only by support reps (private).

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:-

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/addRequestNote"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application or if the user does not have permission to update. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/addRequestNote"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'addRequestNote' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/addRequestNote">

    <input type="hidden" name="apikey" value="[SupportCenter API Key]">

    <input type="text" name="id" value="[Request ID of the request to add note]">

    <input type="text" name="comment" value="[Note added to the request]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    View/Read Notes

     

    This operation displays the notes added to a request by specifying the Request ID.

     

    URL Format

     

     

    The URL format for the Request operation - View/Read Notes

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getRequestNotes

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getRequestNotes

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is given below,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request to view the notes.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST or GET method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/getRequestNotes"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application or if the user does not have permission to update. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

     

    Sample Response

     

    response uri="api/xml/getRequestNotes"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'getRequestNotes' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getRequestNotes">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Request ID of the request to view/read note]">

    <input type="submit" name="submit" value="submit">

    </form>

     

    Update Note

     

    This operation updates the notes added to a request.

     

    URL Format

     

     

    The URL format for the Request operation - Update Note

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/updateNote

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/updateNote

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is given below,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Note ID to delete the note.

     
    comment

     

    string

     

    Description added to the note.

     
    isPublic

     

    True/False

     

    If True, the note can be viewed by all users (public). If false, the note can be viewed only by support reps (private).

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST or GET method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/updateNote"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

     

    Sample Response

     

    response uri="api/xml/updateNote"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=Note ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'updateNote' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/updateNote">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Note ID to update note]">

    <input type="submit" name="submit" value="submit">

    </form>

     

    Delete Note

     

    This operation deletes the notes added to a request.

     

    URL Format

     

     

    The URL format for the Request operation - Delete Note

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/deleteNote

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/deleteNote

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is given below,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Note ID.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST or GET method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/deleteNote"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

     

    Sample Response

     

    response uri="api/xml/deleteNote"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=Note ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'deleteNote' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/deleteNote">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Note ID to delete note]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    Add Attachment

     

    Through this operation, you can add attachments to the existing requests.

     

    URL Format

     

     

    The URL format for the Request operation - Add Attachment

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/addAttachment

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/addAttachment

     

     

     

    Parameters

     

    The following parameters need to be passed via HTTP method.

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request.

     

    fileContent

     

    string

     

    Pass the File Input Stream of the file  

     

    fileName

     

     

    string

     

    Name of the file to be attached.

     

     

    NOTE:

     

    The attachment file size should not exceed the total file size mentioned under the Settings page. If the size exceeds the mentioned value (say, 10 MB), you will receive the following error message: "Error while adding attachment. You can't attach files of size more than 10 MB."

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/addAttachment"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application or if the user does not have permission to update. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/addAttachment"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'addAttachment' is given below,

     

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/addAttachment">

    <input type="hidden" name="apikey" value="[SupportCenter API Key]">

    <input type="text" name="id" value="[Request ID to add attachment]">

    <input type="file" id="files" name="file" onchange="loadFileContent(event)"/>

    <input type="hidden" id="fileContent" name="fileContent" value=""/>

    <input type="hidden" id="fileName" name="fileName" value=""/>

    <input type="submit" name="submit" value="submit">

    </form>

     

    To get the file input stream, use the following script. This script can be run in browsers which supports 'FileReader' objects.

     

    <script>
        function loadFileContent(evt)
        {

    var files = document.getElementById('files').files;
        if (!files.length) {
          alert('Please select a file!');
          return;
        }
          var file = files[0];
          var reader = new FileReader();

        reader.onloadend = function(evt) {
          if (evt.target.readyState == FileReader.DONE) {
              document.getElementById('fileContent').value=reader.result;
              document.getElementById('fileName').value=file.name;
          }
        };
       
        var blob = file.slice(0, file.size);
        reader.readAsDataURL(blob);
         


      }


    </script>

     

     

    You can also run the following program in your Java Environment to upload a file to a request.

     

    Key points:

    1. The operation name "addAttachment " should be sent as a "POST attribute".

    2. The api key should be sent as a "POST attribute" with key "apikey".

     

     

    The snippet provided below is an example of how you can append "Attachments to Requests" written in Java. Using Java code multiple attachments can be uploaded to a request.

     

    {

     

    /**

    *1. Create a PostMethod

    *2. Construct the web URL to connect to the SCPServer

    *3. Add the byte stream of file and other parameters to create a request for post using part

    *4. Set MultipartRequestEntity for post

    *5. Execute the post method

    *6. Receive and process the response as required

    **/

     

    HttpClient client = new HttpClient( );

    String weblinkURL = "http://<SCPServer>:<PortNumber>/api/xml/addAttachment?apikey=<support rep API key>";

    PostMethod post =new PostMethod(weblinkURL);

    //File adding

     

    String fileName = "a.csv";
    String filePath = "C:" + File.pathSeparator + "ManageEngine" + File.pathSeparator + "SupportCenter" ;

    String file = filePath + File.separator + fileName;

    try {

    File f = new File(file);

    FileInputStream fis = new FileInputStream(f);

    ByteArrayOutputStream bos = new ByteArrayOutputStream();

    int c;

    while ((c = fis.read()) != -1)

    {

    bos.write(c);

    }

    byte[] fbArray = bos.toByteArray();

     

    PartSource ps = new ByteArrayPartSource(fileName,fbArray);

    Part[] fields = { new FilePart("image1",ps), new StringPart("id", "Request ID to add attachment") };

    post.setRequestEntity(new MultipartRequestEntity(fields,post.getParams()));

     

    HttpClient client = new HttpClient( );

    client.executeMethod( post );

     

    String response = post.getResponseBodyAsString();

    System.out.println( response );

     

    } catch  (Exception e) {

     

    System.out.println( e );

    e.printStackTrace();

    } finally {

    post.releaseConnection( );

    }

     

     

     

    Output:

     

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

    <response uri="/api/xml/addAttachment">

    <result>

    <statuscode>200</statuscode>

    <status>Success</status>

    <statusmessage>Attachment[s] added successfully for request with ID 1002</statusmessage>

    </result>

    </response>

     

     

     

    Add Resolution

     

    This operation adds the resolution for a request.

     

    URL Format

     

     

    The URL format for the Request operation - Add Resolution

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/addResolution

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/addResolution

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request.

     
    resolution

     

    string

     

    Description of the resolution.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/addResolution"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/addResolution"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=Specified request URI incorrect. Parameters missing.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'addResolution' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/addResolution">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Request ID of the request]">

    <input type="text" name="resolution" value="[Resolution Description]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    View Resolution

     

    Through this operation, you can view the resolutions added to the request.

     

    URL Format

     

     

    The URL format for the Request operation - View Resolution

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getResolution

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getResolution

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request.

     
    htmldescription

     

    True/False

     

    Displays output as html or plain text format. If True, the output is displayed as html format. If False, the output is displayed as a plain text.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/getResolution"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/getResolution"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'getResolution' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getResolution">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Request ID of the request]">

    <input type="submit" name="submit" value="submit">

    </form>

     

    Update Resolution

     

    This operation updates the resolution added to the request.

     

    URL Format

     

     

    The URL format for the Request operation - Update Resolution

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/updateResolution

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/updateResolution

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request.

     
    resolution

     

    string

     

    Description of the resolution.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/updateResolution"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/updateResolution"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'updateResolution' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/updateResolution">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Request ID of the request]">

    <input type="text" name="resolution" value="[Resolution Description]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    Add/Update Resolution and Change the status of a request

     

    Through this operation, you can add/update resolution and change the status of the request.

     

    URL Format

     

     

    The URL format for the Request operation - Add/Update Resolution and Change the status of a request

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/addResolutionAndChangeStatus

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/addResolutionAndChangeStatus

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request.

     
    resolution

     

    string

     

    Description of the resolution.

     
    status

     

    string

     

    Status of the request. Can be Open, Closed, Onhold or any other configured status.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/addResolutionAndChangeStatus"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/addResolutionAndChangeStatus"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'addResolutionAndChangeStatus' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/addResolutionAndChangeStatus">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Request ID of the request]">

    <input type="text" name="resolution" value="[Resolution Description]">

    <input type="text" name="status" value="[Status of the request.]">

    <input type="submit" name="submit" value="submit">

    </form>

     

    Add Time Entry

     

    Through this operation, you can add time entry to the request.

     

    URL Format

     

     

    The URL format for the Request operation - Add Time Entry

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/addTimeEntry

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/addTimeEntry

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request to add the Time Entry.  

     
    executedTime

     

    string

     

    Request resolved time.

     
    time-format

     

    string

     

    Denotes the time format.

     
    supportRep

     

    string

     

    Support Rep assigned to the request.  

     
    billingStatus

     

    billable/non-billable

     

    Billing status of the time entry.

     
    description

     

    string

     

    Comment added to the time entry.

     
    workHours

     

    string

     

    Denotes the hours spent on the request.  

     
    workMinutes

     

    string

     

    Denotes the minutes spent on the request. 

     
    cost

     

    string

     

    Total cost to be paid for resolving the request.  

     
    additionalCost

     

    string

     

    Additional cost to be paid for resolving the request.  

     
    rateType

     

    string

     

    Rate type assigned to the contract.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST or GET method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

     

    Sample Response

     

    response uri="api/xml/addTimeEntry"

     

    status=Success

     

    statuscode=200

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

     

    Sample Response

     

    response uri="api/xml/addTimeEntry"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'addTimeEntry' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/addTimeEntry">

    <input type="hidden" name="apikey" value="[SupportCenter API Key]">

    <input type="text" name="id" value="[Request ID of the request to add time entry]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    View/Read Time Entry

     

    This operation displays the Time Entry added to a request by specifying the Request ID.

     

    URL Format

     

     

    The URL format for the Request operation - View/Read Time Entry

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getTimeEntryDetails

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getTimeEntryDetails

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request to view the Time Entry.  

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST or GET method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

     

    Sample Response

     

    response uri="api/xml/getTimeEntryDetails"

     

    status=Success

     

    statuscode=200

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

     

    Sample Response

     

    response uri="api/xml/getTimeEntryDetails"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'getTimeEntryDetails' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getTimeEntryDetails">

    <input type="hidden" name="apikey" value="[SupportCenter API Key]">

    <input type="text" name="id" value="[Request ID of the request to view/read time entry]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    Update Time Entry

     

    Through this operation, you can update the time entry details.

     

    URL Format

     

     

    The URL format for the Request operation - Update Time Entry

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/updateTimeEntry

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/updateTimeEntry

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Time Entry ID.

     
    executedTime

     

    string

     

    Request resolved time.

     
    time-format

     

    string

     

    Denotes the time format.

     
    supportRep

     

    string

     

    Support Rep assigned to the request.

     
    billingStatus

     

    billable/non-billable

     

    Billing status of the time entry.

     
    description

     

    string

     

    Comments added to the time entry.

     
    workHours

     

    string

     

    Denotes the hours spent on the request.  

     
    workMinutes

     

    string

     

    Denotes the minutes spent on the request. 

     
    cost

     

    string

     

    Total cost charged for resolving the request.

     
    additionalCost

     

    string

     

    Additional cost charged for resolving the request.  

     
    rateType

     

    string

     

    Rate type assigned to the contract.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/updateTimeEntry"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/updateTimeEntry"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Time Entry ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'updateTimeEntry' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/updateTimeEntry">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Time Entry ID to update the time entry]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    Delete Time Entry

     

    This operation deletes the time entries added to a request.

     

    URL Format

     

     

    The URL format for the Request operation - Delete Time Entry

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/deleteTimeEntry

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/deleteTimeEntry

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Time Entry ID.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/deleteTimeEntry"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/deleteTimeEntry"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Time Entry ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'deleteTimeEntry' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/deleteTimeEntry">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Time Entry ID of the request]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    Close Request

     

    URL Format

     

     

    The URL format for the Request operation - Close

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/closeRequest

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/closeRequest

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request to be viewed.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/closeRequest"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/closeRequest"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'closeRequest' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/closeRequest">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Request ID of the request]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    Delete Request

     

    URL Format

     

     

    The URL format for the Request operation - Delete

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/deleteRequest

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/deleteRequest

     

     

     

    Parameters

     

    The parameters that needs to be passed via HTTP method for deleting a new request are as follows,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request to be deleted.

     

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/deleteRequest"

     

    status=Success

     

    statuscode=200

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/deleteRequest"

     

    status=Failure

     

    statuscode=4000

     

    statusmessage=The parameter [apikey] is not available in the request.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'deleteRequest' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/deleteRequest">

    <input type="hidden" name="apikey" value="[SupportCenter API Key]">

    <input type="text" name="id" value="[Request ID]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    View Conversation details of a Request

     

    Through this operation, you can view the conversations of the requests.

     

    URL Format

     

     

    The URL format for the Request operation - View Conversation details of a request

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getConversations

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getConversations

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request.

     

     

    NOTE: The conversation details such as support rep reply, contact reply, request forwards, and notes added to the request will be displayed in the output.

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/getConversations"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/getConversations"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'getConversations' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getConversations">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Request ID of the request]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    View full details of Request Conversation

     

    Through this operation, you can view details of the conversations such as To address, cc address, subject, and full description.

     

    URL Format

     

     

    The URL format for the Request operation - View full details of Request Conversation

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getConversationDetails

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getConversationDetails

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Conversation ID.

     
    notifyType

     

    string

     

    The type of reply.

     
    htmlDescription

     

    True/False

     

    Displays output as html or plain text format. If True, the output is displayed as html format. If False, the output is displayed as a plain text.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:-

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/getConversationDetails"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/getConversationDetails"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=Conversation ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'getConversationDetails' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getConversationDetails">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Notification ID]">

    <input type="text" name="notifyType" value="[The type of reply]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    Reply/Forward Requests

     

    URL Format

     

     

    The URL format for the Request operation - Reply/Forward Requests

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/sendReply

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/sendReply

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    woID

     

    string

     

    The ID of the parent request. If you would like to send reply for the parent request, 'woID' should be specified.

     
    convID

     

    string

     

    The ID of the child request (conversation). If you would like to send reply for the request conversation, 'convID' should be specified.

     
    toAddress

     

    string

     

    The email address to whom the mail has to be sent.

     
    ccAddress

     

    string

     

    The cc address.

     
    subject

     

    string

     

    Subject of the request.

     
    description

     

    string

     

    Description of the request.

     
    htmlDescription

     

    yes/no

     

    If the description is given in html then select 'yes'. If 'no' is selected, the description will be taken as plain text.

     
    includeOriginalContent

     

    yes/no

     

    Denotes whether to include the entire request description along with the reply. If yes, the original content is included. If no, the original content is excluded.

     
    notificationType

     

    string

     

    The type of reply. (REQREPLY / REQFORWARD)

     
    fileContent

     

    string

     

    Pass the File Input Stream of the file

     
    fileName

     

    string

     

    Name of the file to be attached.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:-

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/sendReply"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/sendReply"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=Outgoing Mail Server is not configured yet.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'sendReply' is given below,

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/sendReply">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Request ID of the request]">

    <input type="text" name="toAddress" value="[To Address]">

    <input type="submit" name="submit" value="submit">

    </form>

     

    You can also add attachment while replying/forwarding requests. For more information, refer "Adding Attachments through API".

     

     

    View Recent Activities on a Request

     

    Through this operation, you can view the latest activity made to a specific request. Recent activity can be Note addition, Contact Reply and Support Rep Reply.

     

    URL Format

     

     

    The URL format for the Request operation - View Recent Activities on a request

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getRequestRecentActivity

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getRequestRecentActivity

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    id

     

    string

     

    Request ID of the request.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:-

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/getRequestRecentActivity"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/getRequestRecentActivity"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'getRequestRecentActivity' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getRequestRecentActivity">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="id" value="[Request ID of the request]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    View Reply Properties

     

    Through this operation, you can view the reply properties of a request such as to address, cc address, and subject.

     

    URL Format

     

     

    The URL format for the Request operation - View Reply Properties

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getReplyProperties

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getReplyProperties

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    woID

     

    string

     

    Request ID of the request.

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:-

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/getReplyProperties"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/getReplyProperties"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=The Request ID [ ] not found.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'getReplyProperties' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getReplyProperties">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="woID" value="[Request ID of the request]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    View My Request Summary from a Business Unit

     

    Through this operation, you can view your request summary from a business unit. This operation displays the count of requests that are open, pending requests, overdue requests, and the count of requests due for that day.

     

    URL Format

     

     

    The URL format for the Request operation - My Request Summary from a Business Unit

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getMyRequestSummary

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getMyRequestSummary

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    businessUnit

     

    string

     

    Business Unit

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:-

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/getMyRequestSummary"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/getMyRequestSummary"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=No such Business Unit exists.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'getMyRequestSummary' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getMyRequestSummary">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="businessUnit" value="[Business Unit]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    View Request Summary of a Business Unit

     

    Through this operation, you can view the request summary of a business unit. This operation displays the count of requests that are open, pending requests, overdue requests, and the count of requests due for that day.

     

    URL Format

     

     

    The URL format for the Request operation - Request Summary details of a business unit

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getRequestSummary

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getRequestSummary

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    businessUnit

     

    string

     

    Business Unit

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:-

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/getRequestSummary"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/getRequestSummary"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=No such Business Unit exists.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'getRequestSummary' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getRequestSummary">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="businessUnit" value="[Business Unit]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    View list of Request Fields from a Business Unit

     

    Through this operation, you can view the list of request fields from a business unit.

     

    URL Format

     

     

    The URL format for the Request operation - Request Field list from a business unit

     

    For xml output
     

    http://<server-name>:<port-number>/api/xml/getFieldList

     

     

    For json output

     

    http://<server-name>:<port-number>/api/json/getFieldList

     

     

     

    Parameters

     

    The parameter to be passed via HTTP method is,

     

     

    Parameter

     

    Value

     

    Description

     
    businessUnit

     

    string

     

    Business Unit

     
    fieldName

     

    string

     

    Name of the field.

     

     

    Note

    1. The list can be viewed only for the fields such as status, level, mode, priority, category, subCategory, item, requestTemplate, product, group, supportRep, supportRepWithCost, and rateType.

    2. To get the list of support reps from a group, send the input as <input type="text" name="group" value="[Group Name]">. To get all the support reps from the business unit, do not use 'group'.

    3. To get the list of subCategroy of a category, send the input as <input type="text" name="category" value="[Category]">.

    4. To get the list of item of a subCategory, send the input as <input type="text" name="subCategory" value="[Sub Category]">.

     

     

     

    Output Response Format

     

    The output response format for both xml and json consists of three parameters:-

    • response uri: The response uri is the url value sent over HTTP POST method.

    • status: The status denotes the status of the operation. Here there are only two status - Success and Failure.

    • statuscode: The statuscode denotes the code displayed when the status is Success or Failure. For a successful operation, the status code is 200.

    Success

     

    When the operation is successful, the output response format is as given below,

     

    response uri=[url value]

     

    status=Success

     

    statuscode=200

     

     

    Sample Response

     

    response uri="api/xml/getFieldList"

     

    status=Success

     

    statuscode=200

     

     

     

    Error

     

    Errors occur when the API Key is not valid or the parameter value does not exist in the application. In such cases, the output format is as shown below,

     

    response uri=[url value]

     

    status=Failure

     

    statuscode=failurecode

     

     

    Sample Response

     

    response uri="api/xml/getFieldList"

     

    status=Failure

     

    statuscode=5000

     

    statusmessage=No such Business Unit exists.

     

     

     

    Sample Input Form

     

    Sample form for the operation 'getFieldList' is given below,

     

    <form method="GET" action="http(s)://<server-name>:<port-number>/api/xml/getFieldList">

    <input type="hidden" name="apikey" value="[SupportCenter-API-Key]">

    <input type="text" name="businessunit" value="[Business Unit]">

    <input type="text" name="fieldName" value="[Field Name]">

    <input type="submit" name="submit" value="submit">

    </form>

     

     

    Adding Attachments through API

     

    Attachments can be uploaded using SupportCenter Plus API. Follow the sample format given below to add attachment.

     

     

    <form method="POST" action="http(s)://<server-name>:<port-number>/api/xml/<apicall>">

    <input type="hidden" name="apikey" value="[SupportCenter API Key]">

    <input type="text" name="[parameter]" value="[value]">

    <input type="text" name="[parameter1]" value="[value1]">

    <input type="file" id="files" name="file" onchange="loadFileContent(event)"/>

    <input type="hidden" id="fileContent" name="fileContent" value=""/>

    <input type="hidden" id="fileName" name="fileName" value=""/>

    <input type="submit" name="submit" value="submit">

    </form>

     

    To get the file input stream, use the following script. This script can be run in browsers which supports 'FileReader' objects.

     

    <script>
        function loadFileContent(evt)
        {

    var files = document.getElementById('files').files;
        if (!files.length) {
          alert('Please select a file!');
          return;
        }
          var file = files[0];
          var reader = new FileReader();

        reader.onloadend = function(evt) {
          if (evt.target.readyState == FileReader.DONE) {
              document.getElementById('fileContent').value=reader.result;
              document.getElementById('fileName').value=file.name;
          }
        };
       
        var blob = file.slice(0, file.size);
        reader.readAsDataURL(blob);
         


      }


    </script>

     

    You can also run the following program in your Java Environment to add attachment.

     

     

    The snippet provided below is an example of how you can append attachments written in Java. Using Java code multiple attachments can be uploaded.

     

    {

     

    /**

    *1. Create a PostMethod

    *2. Construct the web URL to connect to the SCPServer

    *3. Add the byte stream of file and other parameters for post using part

    *4. Set MultipartRequestEntity for post

    *5. Execute the post method

    *6. Receive and process the response as required

    **/

     

    HttpClient client = new HttpClient( );

    String weblinkURL = "http://<SCPServer>:<PortNumber>/api/xml/<apicall>?apikey=<support rep API key>";

    PostMethod post =new PostMethod(weblinkURL);

    //File adding

     

    String fileName = "a.csv";
    String filePath = "C:" + File.pathSeparator + "ManageEngine" + File.pathSeparator + "SupportCenter" ;

    String file = filePath + File.separator + fileName;

    try {

    File f = new File(file);

    FileInputStream fis = new FileInputStream(f);

    ByteArrayOutputStream bos = new ByteArrayOutputStream();

    int c;

    while ((c = fis.read()) != -1)

    {

    bos.write(c);

    }

    byte[] fbArray = bos.toByteArray();

     

    PartSource ps = new ByteArrayPartSource(fileName,fbArray);
    Part[] fields = { new FilePart("image1",ps), new StringPart("parameter", "value"), new StringPart("parameter1", "value1") };

     

    /* For example, to add attachment while creating a request, you can write the code as mentioned below:

     

    Part[] fields = { new FilePart("image1",ps), new StringPart("email", "adam@acme.com"), new StringPart("subject", "subject of the request") };

     

    */

     

    post.setRequestEntity(new MultipartRequestEntity(fields,post.getParams()));

     

    HttpClient client = new HttpClient( );

    client.executeMethod( post );

     

    String response = post.getResponseBodyAsString();

    System.out.println( response );

     

    } catch  (Exception e) {

     

    System.out.println( e );

    e.printStackTrace();

    } finally {

    post.releaseConnection( );

     

    }

     

     

    NOTE:

    1. The attachment file size should not exceed the total file size mentioned under the Settings page. If the size exceeds the mentioned value (say, 10 MB), you will receive the following error message: "Error while adding attachment. You can't attach files of size more than 10 MB."

    2. Currently, SupportCenter Plus API supports to add file attachments only while adding, replying and forwarding requests.
     

    Copyright © 2017, ZOHO Corp. All Rights Reserved.