Get User Credentials
Create an basecamp account using URL: https://www.basecamp.com/
Follow the below mentioned steps to generate the access token
Click on Register Application
Give proper values for
- Name of Your Application
- Your company’s name
- Your website URL
- Check the products that your application integrate with.
- Redirect URL - Enter the Callback URL
Click on Register this App and get client Id, client Secret. Store them for future use
- Get the Authorization code from Azure Access Control Service Construct the authorization url as: https://launchpad.37signals.com/authorization/new?type=web_server&client_id=your-client-id&redirect_uri=your-redirect-uri
It ask whether it's ok to give access to your app. Click on Yes,I'll allow access.
Basecamp site redirects the browser back to the redirect URI that was specified when the app was registered in step 3. It also includes the authorization code as a query string. The redirect URL is structured like: https://redirect_url?code=<authorization_code>. Extract query string value code from the url and it will be used in next step.
- Get the access token and refresh token from code, construct the post request URL: https://launchpad.37signals.com/authorization/token?type=web_server&client_id=your-client-id&redirect_uri=your-redirect-uri&client_secret=your-client-secret&code=verification-code
Initializing the Connector
To use the Basecamp connector, add the <basecamp.init>
element in your configuration before carrying out any other operations. All Basecamp API requests can be authenticated by passing along an OAuth 2 token. Click here for further reference on the authentication process.
<basecamp.init> <accessToken>{$ctx:accessToken}</accessToken> <apiUrl>{$ctx:apiUrl}</apiUrl> <accountId>{$ctx:accountId}</accountId> <userAgent>{$ctx:userAgent}</userAgent> <eTag>{$ctx:eTag}</eTag> <lastModifiedDate>{$ctx:lastModifiedDate}</lastModifiedDate> </basecamp.init>
Properties
accessToken:
The access token to authenticate Basecamp using OAuth 2.0.apiUrl:
The URL of the Basecamp API.accountId:
The unique identifier of the account(You can find the accountId in basecamp URL. The URL is structured like : https://3.basecamp.com/<accountId>/projects).userAgent:
This is used by the API to store developer information.eTag:
Optional - The e-tag of a previously given response.lastModifiedDate:
Optional - The last modified date of the resource.
Additional information
Ensure that the following Axis2 configurations are added and enabled in the <EI_HOME>\conf\axis2\axis2.xml
file.
Required message formatters
<messageFormatter contentType="text/html" class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
Required message builders
<messageBuilder contentType="text/html" class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
Follow the below-mentioned steps to add a valid certificate to access basecamp API over https.
- Download the certificate by navigating to https://basecamp.com
- Place the downloaded certificate into "<EI_HOME>/repository/resources/security/" folder.
Navigate to "<EI_HOME>/repository/resources/security/" using the command prompt and execute the following command.
keytool -importcert -file CERT_FILE_NAME -keystore client-truststore.jks -alias "CERT_NAME"
This command will import Basecamp certificate into keystore.To import the certificate give "wso2carbon" as password. Press "Y" to complete certificate import process.
- similarly Place the downloaded certificate into "<BASECAMP_CONNECTOR_HOME>/src/test/resources/keystores/products" folder.
Navigate to "<BASECAMP_CONNECTOR_HOME>/src/test/resources/keystores/products" using the command prompt and execute the following command.
keytool -importcert -file CERT_FILE_NAME -keystore wso2carbon.jks -alias "CERT_NAME"
This command will import Basecamp certificate into keystore.To import the certificate give "wso2carbon" as password. Press "Y" to complete certificate import process.
Note
- CERT_FILE_NAME - Replace CERT_FILE_NAME with the file name that was extracted from basecamp with the extension (e.g. basecampcom.crt).
- CERT_NAME - Replace CERT_NAME with name for the certificate (e.g. basecamp)
Now that you have connected to Basecamp, use the information in the following topics to perform various operations with the connector.