Table of Contents

Keys (RESTful) API

Using Keys API you can generate and manipulate ChiliFresh Reviews API keys. It has output available in XML and JSON.

generateKey call

Input

Parameters

ParameterType (size)MandatoryDescription
accountInteger (10)YesChiliFresh library account ID

Output

Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (1)AlwaysSee reference below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s -hhmm)AlwaysExample: Thu, 30 Jun 2010 07:25:58 -0500
responseapi_key Varchar(32) If successful request Reviews API key
Block response ends

XML input example:

https://secure.chilifresh.com/api/generatekey/?account=1234&action=generateKey

XML output example:

<response>
       <response_code>100</response_code>
       <response_description>API key generated</response_description>
       <response_time>Fri, 05 Aug 2011 20:26:12</response_time>
       <api_key>492450b3d1a94c136887cef5c317713f</api_key>
</response>

JSON input example:

https://secure.chilifresh.com/api/generatekey/json/?account=1234&action=generateKey

JSON output example:

{"response":
            {"response_code":"100",
             "response_description":"API key generated",
             "response_time":"Fri, 05 Aug 2011 20:29:41",
             "api_key":"80db3274f63128835425145be21311c4"}
}

Response codes

Response code Response description
100API key generated
101API key generating error

destroyKey call

Input

Parameters

ParameterType (size)MandatoryDescription
accountInteger (10)YesChiliFresh library account ID
api_keyVarchar (32)YesValid API key

Output

Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (1)AlwaysSee reference below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s -hhmm)AlwaysExample: Thu, 30 Jun 2010 07:25:58 -0500
responseapi_key Varchar(32) If successful request Reviews API key
Block response ends

XML input example:

https://secure.chilifresh.com/api/generatekey/?account=1234&action=destroyKey&api_key=90a8s0d98a09s8d90a8s0d8

XML output example:

<response>
       <response_code>200</response_code>
       <response_description>API key destroyed</response_description>
       <response_time>Fri, 05 Aug 2011 20:26:12</response_time>
       <api_key>492450b3d1a94c136887cef5c317713f</api_key>
</response>

JSON input example:

https://secure.chilifresh.com/api/generatekey/json/?account=1234&action=destroyKey&api_key=90a8s0d98a09s8d90a8s0d8

JSON output example:

{"response":
            {"response_code":"200",
             "response_description":"API key destroyed",
             "response_time":"Fri, 05 Aug 2011 20:29:41",
             "api_key":"80db3274f63128835425145be21311c4"}
}

Response codes

Response code Response description
200API key destroyed
201Invalid API key
202API key destroy error

activateKey call

Input

Parameters

ParameterType (size)MandatoryDescription
accountInteger (10)YesChiliFresh library account ID
api_keyVarchar (32)YesValid API key

Output

Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (1)AlwaysSee reference below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s -hhmm)AlwaysExample: Thu, 30 Jun 2010 07:25:58 -0500
responseapi_key Varchar(32) If successful request Reviews API key
Block response ends

XML input example:

https://secure.chilifresh.com/api/generatekey/?account=1234&action=activateKey&api_key=asd90ais0d98a0s9d

XML output example:

<response>
         <response_code>300</response_code>
         <response_description>API key activated</response_description>
         <response_time>Fri, 05 Aug 2011 20:47:50</response_time>
         <api_key>80db3274f63128835425145be21311c4</api_key>
</response>

JSON input example:

https://secure.chilifresh.com/api/generatekey/json/?account=1234&action=activateKey&api_key=asd90ais0d98a0s9d

JSON output example:

{"response":
            {"response_code":"300",
            "response_description":"API key activated",
            "response_time":"Fri, 05 Aug 2011 20:50:20",
            "api_key":"80db3274f63128835425145be21311c4"}
}

Response codes

Response code Response description
300API key activated
301API key already active
302Invalid API key
303API key activate error

deactivateKey call

Input

Parameters

ParameterType (size)MandatoryDescription
accountInteger (10)YesChiliFresh library account ID

Output

Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (1)AlwaysSee reference below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s -hhmm)AlwaysExample: Thu, 30 Jun 2010 07:25:58 -0500
responseapi_key Varchar(32) If successful request Reviews API key
Block response ends

XML input example:

https://secure.chilifresh.com/api/generatekey/?account=1234&action=deactivateKey&api_key=asd90ais0d98a0s9d

XML output example:

<response>
         <response_code>400</response_code>
         <response_description>API key deactivated</response_description>
         <response_time>Fri, 05 Aug 2011 20:47:50</response_time>
         <api_key>80db3274f63128835425145be21311c4</api_key>
</response>

JSON input example:

https://secure.chilifresh.com/api/generatekey/json/?account=1234&action=deactivateKey&api_key=asd90ais0d98a0s9d

JSON output example:

{"response":
            {"response_code":"400",
            "response_description":"API key deactivated",
            "response_time":"Fri, 05 Aug 2011 20:50:20",
            "api_key":"80db3274f63128835425145be21311c4"}
}

Response codes

Response code Response description
400API key deactivated
401API key already inactive
402Invalid API key
403API key deactivate error

General errors

Error code Error description
0System error
1Empty account ID
2Action not specified