Awesome
Apex Google Cloud Print API Framework
<a href="https://githubsfdeploy.herokuapp.com?owner=financialforcedev&repo=ffhttp-googlecloudprint"> <img alt="Deploy to Salesforce" src="https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/src/main/webapp/resources/img/deploy.png"> </a>Overview
An Apex framework has been created to provide functionality for Google Cloud Print API callouts.
This library extends the Core library to provide access to Google Cloud Print API calls found at https://developers.google.com/cloud-print/.
Samples demonstrating the use of this library can be found here.
Key Features
- Apex Google Cloud Print API
Configuration
This section explains how to create a connection between Salesforce and Google Cloud Print using the packages described above.
Make sure that the Core and Google Cloud Print packages have been deployed to your Saleforce organisation.
###Create an app in Google
- Log in to your Google account.
- Go to https://console.developers.google.com/project and select Create Project.
- Enter a project name and ok the dialog.
- Select the hyperlink for the project name that you just created.
- Select Credentials.
- Select Create new Client ID.
- Select Web application.
- Set the Authorized Javascript Origins url to the URL of the Salesforce organisation e.g. https://eu3.salesforce.com.
- Set the Authorized Redirect URIs to the same as above with apex/connector appended: e.g. https://eu3.salesforce.com/apex/connector.
- Make sure you know the Client Id and Client Secret as they will be needed later.
- Select the Consent screen.
- Enter a Product Name and save.
###Create a Connector in Salesforce
This requires the OAuth Sample App to be deployed.
- Log in to your Salesforce organisation.
- Select the OAuth Sample App.
- Select Connector Types then New.
- Enter a Connector Type Name e.g. Google Cloud Print.
- Set the Authorization Endpoint to https://accounts.google.com/o/oauth2/auth.
- Set the Token Endpoint to https://accounts.google.com/o/oauth2/token.
- Set the Client ID to the client ID obtained earlier.
- Set the Client Secret to the client secret obtained earlier.
- Set the Redirect URI to the same URL as you set in step 9 in the Create an app in Google section.
- Make sure that Scope Required is checked.
- Set the Scope to https://www.googleapis.com/auth/cloudprint.
- Set the Extra Url Parameters to access_type=offline&approval_prompt=force. Setting access_type to offline means that Google supplies a refresh token with the access token which is required if you do not wish to reauthenticate every time the access token expires.
- Save the Connector Type.
- Select New Connector.
- Set the Connector Name and save.
- Select the Connector and then Activate. You will be directed to another Salesforce page that activates your connector.
- Select Authorize. This will prompt you to log in to your Google account (if you are not already logged in) and then authenticate the scope provided earlier. Select Accept to authorize.
- Select Save. The connector is now ready for use.
Reporting Issues & Enhancements
Please report any issues using the github issues feature. Suggestions / bug reports are welcome as are extensions containing additional functionality.