This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Hooks in CodePlex
Overview
The following operations allow you to work with Hooks in CodePlex. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with Users, see Sample configuration.
Operation | Description |
---|---|
getSupportedHooks | Provides supported hooks for a specified codeplex project. |
getHookSubscriptions | Provides subscription list for a specified codeplex project and hook. |
getSubscription | Provide subscription details of specified subscription id, hook and project. |
createSubscription | Create a subscription on a specified hook and project. |
updateSubscription | Update specified subscription. |
deleteSubscription | Delete specified subscription. |
Operation details
This section provides the details on each operation related to Hooks in CodePlex.
Get the list of supported service hooks
<codeplex.getSupportedHooks> <project>geospatial</project> </codeplex.getSupportedHooks>
Properties
- clientId          : Client Id of the CodePlex app.
- clientSecret  : Client secret of the CodePlex.
- refreshToken : Refresh token acquired from codeplex OAuth.
- project          :The name of the project to retrieve its supported hooks.
Sample request
Following is a sample REST/JSON request that can be handled by the getSupportedHooks
operation.
{ "clientId":"e2ca3fc77e334c679f0c5c50257f9f37", "clientSecret":"44c635345fbd408d96e675b0aaf13343", "refreshToken":"L4Eo!IAAAAL3yP6zFRfsriup7jYcQThecBNIpHJ4UJFfYfGKDP2MNsQAAAAHxh0bbfEjjP7RDQBsRrELlW6cZDe4sGcT5jp3jNGxSkmwUZya3qDhgcPVxOyIuj-SC0fhdc5LP8xIqOWqR1SjiDa9d29uvopFxv-da14X2i_QByD1XCKPUHie04VKVphk_q0ta9AjsXc9MrUR9a6O24U_Da9srHendD0TJJKfygjHgYvFzkO3KIcoHmG2abPHybkBOBQHyltaHJwfESYohqHqRhL_FwJfnSRJjrzq8dl", "project":"geospatial" }
Get the list of subscriptions for a service hook
<codeplex.getHookSubscriptions> <project>geospatial</project> <hookId>8</hookId> </codeplex.getHookSubscriptions>
Properties
- clientId          : Client Id of the CodePlex app.
- clientSecret  : Client secret of the CodePlex.
- refreshToken : Refresh token acquired from codeplex OAuth.
- project          : The name of the project.
hookId          : The Identification of the hook.
Sample request
Following is a sample REST/JSON request that can be handled by the getHookSubscriptions
operation.
{ "clientId":"e2ca3fc77e334c679f0c5c50257f9f37", "clientSecret":"44c635345fbd408d96e675b0aaf13343", "refreshToken":"L4Eo!IAAAAL3yP6zFRfsriup7jYcQThecBNIpHJ4UJFfYfGKDP2MNsQAAAAHxh0bbfEjjP7RDQBsRrELlW6cZDe4sGcT5jp3jNGxSkmwUZya3qDhgcPVxOyIuj-SC0fhdc5LP8xIqOWqR1SjiDa9d29uvopFxv-da14X2i_QByD1XCKPUHie04VKVphk_q0ta9AjsXc9MrUR9a6O24U_Da9srHendD0TJJKfygjHgYvFzkO3KIcoHmG2abPHybkBOBQHyltaHJwfESYohqHqRhL_FwJfnSRJjrzq8dl", "project":"geospatial", "hookId":"8" }
Get subscription
<codeplex.getSubscription> <project>geospatial</project> <hookId>4</hookId> <subscriptionId>3735</subscriptionId> </codeplex.getSubscription>
Properties
- clientId            : Client Id of the CodePlex app.
- clientSecret    : Client secret of the CodePlex.
- refreshToken  : Refresh token acquired from codeplex OAuth.
- project            :The name of the project.
hookId            : The Identification of the hook.
subscriptionId : The Identification of the subscription.
Sample request
Following is a sample REST/JSON request that can be handled by the getSubscription
operation.
{ "clientId":"e2ca3fc77e334c679f0c5c50257f9f37", "clientSecret":"44c635345fbd408d96e675b0aaf13343", "refreshToken":"L4Eo!IAAAAL3yP6zFRfsriup7jYcQThecBNIpHJ4UJFfYfGKDP2MNsQAAAAHxh0bbfEjjP7RDQBsRrELlW6cZDe4sGcT5jp3jNGxSkmwUZya3qDhgcPVxOyIuj-SC0fhdc5LP8xIqOWqR1SjiDa9d29uvopFxv-da14X2i_QByD1XCKPUHie04VKVphk_q0ta9AjsXc9MrUR9a6O24U_Da9srHendD0TJJKfygjHgYvFzkO3KIcoHmG2abPHybkBOBQHyltaHJwfESYohqHqRhL_FwJfnSRJjrzq8dl", "subscriptionId":"3735", "project":"geospatial", "hookId":"4" }
Create subscription
<codeplex.createSubscription> <project>geospatial</project> <hookId>4</hookId> <eventName>Code Change</eventName> <eventEnabled>true</eventEnabled> <eventProperties>[{'Name':'url','Value':'val'}]</eventProperties> <subscriptionProperties></subscriptionProperties> </codeplex.createSubscription>
Properties
- clientId                       : Client Id of the CodePlex app.
- clientSecret                : Client secret of the CodePlex.
- refreshToken              : Refresh token acquired from codeplex OAuth.
- project                        : The name of the project.
hookId                 : The Identification of the hook.
eventName                 : Subscribing event name.
eventEnabled             : Event enabled or Disabled.
eventProperties          : Properties of event.
subscriptionProperties : Properties of subscription.
Sample request
Following is a sample REST/JSON request that can be handled by the createSubscription
operation.
{ "clientId":"e2ca3fc77e334c679f0c5c50257f9f37", "clientSecret":"44c635345fbd408d96e675b0aaf13343", "refreshToken":"L4Eo!IAAAAL3yP6zFRfsriup7jYcQThecBNIpHJ4UJFfYfGKDP2MNsQAAAAHxh0bbfEjjP7RDQBsRrELlW6cZDe4sGcT5jp3jNGxSkmwUZya3qDhgcPVxOyIuj-SC0fhdc5LP8xIqOWqR1SjiDa9d29uvopFxv-da14X2i_QByD1XCKPUHie04VKVphk_q0ta9AjsXc9MrUR9a6O24U_Da9srHendD0TJJKfygjHgYvFzkO3KIcoHmG2abPHybkBOBQHyltaHJwfESYohqHqRhL_FwJfnSRJjrzq8dl", "project":"geospatial", "hookId":"4", "eventName":"Code Change", "eventEnabled":"true", "eventProperties":"[{'Name':'url','Value':'val'}]", "subscriptionProperties":"" }
Update subscription
<codeplex.updateSubscription> <subscriptionId>3989</subscriptionId> Â <project>geospatial</project> <hookId>8</hookId> <eventName>Code Change</eventName> <eventEnabled>true</eventEnabled> <eventProperties></eventProperties> <subscriptionProperties></subscriptionProperties> </codeplex.updateSubscription>
Properties
- clientId             : Client Id of the CodePlex app.
- clientSecret                : Client secret of the CodePlex.
- refreshToken              : Refresh token acquired from codeplex OAuth.
- project                        : The name of the project.
- hookId                 : The Identification of the hook.
- eventName                 : Subscribing event name.
- eventEnabled             : Event enabled or Disabled.
- eventProperties          : Properties of event.
- subscriptionProperties : Properties of subscription.
subscriptionId              : The Identification of the subscription.
Sample request
Following is a sample REST/JSON request that can be handled by the updateSubscription
operation.
{ "clientId":"e2ca3fc77e334c679f0c5c50257f9f37", "clientSecret":"44c635345fbd408d96e675b0aaf13343", "refreshToken":"L4Eo!IAAAAL3yP6zFRfsriup7jYcQThecBNIpHJ4UJFfYfGKDP2MNsQAAAAHxh0bbfEjjP7RDQBsRrELlW6cZDe4sGcT5jp3jNGxSkmwUZya3qDhgcPVxOyIuj-SC0fhdc5LP8xIqOWqR1SjiDa9d29uvopFxv-da14X2i_QByD1XCKPUHie04VKVphk_q0ta9AjsXc9MrUR9a6O24U_Da9srHendD0TJJKfygjHgYvFzkO3KIcoHmG2abPHybkBOBQHyltaHJwfESYohqHqRhL_FwJfnSRJjrzq8dl", "subscriptionId":"3989", "project":"geospatial", "hookId":"8", "eventName":"Code Change", "eventEnabled":"true", "eventProperties":"", "subscriptionProperties":"" }
Delete a subscription
<codeplex.deleteSubscription> <project>geospatial</project> <hookId>8</hookId> <subscriptionId>3989</subscriptionId> </codeplex.deleteSubscription>
Properties
- clientId      : Client Id of the CodePlex app.
- clientSecret   : Client secret of the CodePlex.
- refreshToken : Refresh token acquired from codeplex OAuth.
- project           :The name of the project.
hookId           : The Identification of the hook.
subscriptionId : The Identification of the subscription.
Sample request
Following is a sample REST/JSON request that can be handled by the deleteSubscription
operation.
{ "clientId":"e2ca3fc77e334c679f0c5c50257f9f37", "clientSecret":"44c635345fbd408d96e675b0aaf13343", "refreshToken":"L4Eo!IAAAAL3yP6zFRfsriup7jYcQThecBNIpHJ4UJFfYfGKDP2MNsQAAAAHxh0bbfEjjP7RDQBsRrELlW6cZDe4sGcT5jp3jNGxSkmwUZya3qDhgcPVxOyIuj-SC0fhdc5LP8xIqOWqR1SjiDa9d29uvopFxv-da14X2i_QByD1XCKPUHie04VKVphk_q0ta9AjsXc9MrUR9a6O24U_Da9srHendD0TJJKfygjHgYvFzkO3KIcoHmG2abPHybkBOBQHyltaHJwfESYohqHqRhL_FwJfnSRJjrzq8dl", "subscriptionId":"3989", "project":"geospatial", "hookId":"8" }
Sample configuration
Following is a sample proxy service that illustrates how to connect to CodePlex with getAccessToken
operation to use the getSupportedHooks
operation. The sample request for this proxy can be found in getSupportedHooks sample request.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="codeplexGetSupportedHooksProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <property name="clientId" expression="json-eval($.clientId)"/> <property name="clientSecret" expression="json-eval($.clientSecret)"/> <property name="refreshToken" expression="json-eval($.refreshToken)"/> <property name="project" expression="json-eval($.project)"/> <codeplex.getAccessToken> <clientId>{$ctx:clientId}</clientId> <clientSecret>{$ctx:clientSecret}</clientSecret> <refreshToken>{$ctx:refreshToken}</refreshToken> </codeplex.getAccessToken> <codeplex.getSupportedHooks> <project>{$ctx:project}</project> </codeplex.getSupportedHooks> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>