If there are multiple instances of UGC with which communication is required, you have the option to deploy an API proxy. The REST API of the proxy gives you the possibility to request voting reports or commit votings, quizzes, and forms to different UGC instances.
Configuration UGC Connections
The connection to diffrent UGC instances can be easily configured. For every UGC instance you have to define a unique tenantId to access the instances. Furthermore a UGC URL and the S3 Configuration of the instance is required.
| Attributes | Description |
|---|---|
| ugc-proxy.tenants.<tenantId>.ugc-url | URL that points to the location of UGC, including the HTTP protocol. If the ugc instance is secured by authentication you can provide the credentials in the url, e.g. "http://username:password@domain.com" |
| ugc-proxy.tenants.<tenantId>.s3.access-key-id | Access key for UGC S3 bucket |
| ugc-proxy.tenants.<tenantId>.s3.secret-access-key | Secret key, usually bundled with the previous access key |
| ugc-proxy.tenants.<tenantId>.s3.host | Host for the S3 bucket, e.g. "storage.googleapis.com" |
| ugc-proxy.tenants.<tenantId>.s3.bucket-name | Name of the bucket in which UGC submissions are stored |
REST API
The REST API provides you with the ability to make calls to different UGC instances using their tenantId.
Data Classes
The data classes used by the REST API are defined in the UGC API Module. They can be used by adding the following code to your pom.xml.
<dependency>
<groupId>com.subshell.sophora.ugc</groupId>
<artifactId>ugc-api</artifactId>
<version>X.X.X</version>
</dependency>
Endpoints
The following REST endpoints are available. Post endpoints:
| Name | Path | Input Data Class | Description |
|---|---|---|---|
| Voting Submission | /v1/voting/{tanantId} | VotingSubmission | Submit a user voting to UGC with the tenantId of the UGC instance. |
| Quiz Submission | /v1/quiz/{tanantId} | QuizSubmission | Submit a user quiz to UGC with the tenantId of the UGC instance. |
| Form Submission | /v1/form/{tanantId} | FormSubmission | Submit a user form to UGC with the tenantId of the UGC instance. |
| Opt-In Confirmation | /v1/doubleoptinconfirmation/{tanantId} | DoubleOptInConfirmation | Confirm double Opt-In with the tenantId of the UGC instance. |
GET endpoints:
| Name | Path | Response Data Class | Description |
|---|---|---|---|
| Ranking Voting Report | /v1/votingreport/ranking/{tanantId}/{externalId} | RankingVotingReport | Request a ranking voting report with the external Id of the corresponding votings and the tenantId of the UGC instance. |
| Simple Voting Report | /v1/votingreport/simple/{tanantId}/{externalId} | SimpleVotingReport | Request a simple voting report with the external Id of the corresponding votings and the tenantId of the UGC instance. |