Package com.patreonshout.rest.interfaces
Interface ReceiverImpl
- All Known Implementing Classes:
ReceiverSvc
@RequestMapping("/receivers")
public interface ReceiverImpl
-
Method Summary
Modifier and Type Method Description java.lang.String
PatreonOAuth(java.lang.String code, java.lang.String state)
Is called by Patreon in order to give us information for linking a user's account via OAuthorg.springframework.http.ResponseEntity<?>
PatreonWebhook(java.lang.String patreonSignature, java.lang.String patreonEvent, java.lang.String userAgent, WebhookRequest webhookRequest, long webaccountId)
Receives post information from Patreon after a post is either published, updated, or deleted, initiates cross postingjava.lang.String
TwitterOAuth(java.lang.String code, java.lang.String state)
Is called by Twitter in order to give us information for linking a user's account via OAuth
-
Method Details
-
PatreonOAuth
@GetMapping("/patreon/oauth") java.lang.String PatreonOAuth(@RequestParam(required=false,name="code") java.lang.String code, @RequestParam(required=false,name="state") java.lang.String state) throws java.io.IOException, PSExceptionIs called by Patreon in order to give us information for linking a user's account via OAuth- Parameters:
code
- is used to fetch access tokens for the session that just signed in with Patreonstate
- is transparently appended from the state param provided in PatreonShout Client from Dev Portal- Returns:
- a json body telling the user that their Patreon was successfully OAuth'd
- Throws:
java.io.IOException
- when we cannot parse the inputPSException
- when there is an internal error with Patreon Shout
-
TwitterOAuth
@GetMapping("twitter/oauth") java.lang.String TwitterOAuth(@RequestParam(required=false,name="code") java.lang.String code, @RequestParam(required=false,name="state") java.lang.String state) throws org.json.simple.parser.ParseException, PSExceptionIs called by Twitter in order to give us information for linking a user's account via OAuth- Parameters:
code
- is used to fetch access tokens for the session that just signed in with Patreonstate
- is transparently appended from the state param provided in PatreonShout Client from Dev Portal- Returns:
- a json body telling the user that their Twitter was successfully OAuth'd
- Throws:
org.json.simple.parser.ParseException
PSException
-
PatreonWebhook
@PostMapping("/patreon/webhook/{webaccountId}") org.springframework.http.ResponseEntity<?> PatreonWebhook(@RequestHeader("x-patreon-signature") java.lang.String patreonSignature, @RequestHeader("x-patreon-event") java.lang.String patreonEvent, @RequestHeader("User-Agent") java.lang.String userAgent, @RequestBody WebhookRequest webhookRequest, @PathVariable long webaccountId) throws PSExceptionReceives post information from Patreon after a post is either published, updated, or deleted, initiates cross posting- Parameters:
patreonSignature
- is the HEX digest of the message body HMAC signed (with MD5) using your webhook's secretpatreonEvent
- is the event happening for the trigger requestuserAgent
- is the user agent of the Patreon requestwebhookRequest
- is the webhook request from PatreonwebaccountId
- is the user's web account id for the request- Returns:
HttpStatus.OK
if successful- Throws:
PSException
-