Skip to content

Commit f434466

Browse files
authored
Merge pull request #30 from warrenbuckley/feature/meetup.com
Adds Meetup.com to example site
2 parents ef14c2c + b8b9130 commit f434466

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

examples/Umbraco.AuthorizedServices.TestSite/Controllers/TestAuthorizedServicesController.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ public class TestAuthorizedServicesController : UmbracoApiController
1212

1313
public TestAuthorizedServicesController(IAuthorizedServiceCaller authorizedServiceCaller) => _authorizedServiceCaller = authorizedServiceCaller;
1414

15+
// /umbraco/api/TestAuthorizedServices/GetMeetupSelfUserInfo
16+
public async Task<IActionResult> GetMeetupSelfUserInfo()
17+
{
18+
// This makes a GraphQL query
19+
var response = await _authorizedServiceCaller.SendRequestRawAsync(
20+
"meetup",
21+
"/gql",
22+
HttpMethod.Post,
23+
new MeetupRequest
24+
{
25+
Query = "query { self { id name bio city } }"
26+
});
27+
28+
return Content(response);
29+
}
30+
1531
public async Task<IActionResult> GetUmbracoContributorsFromGitHub()
1632
{
1733
List<GitHubContributorResponse>? response = await _authorizedServiceCaller.GetRequestAsync<List<GitHubContributorResponse>>(
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Umbraco.AuthorizedServices.TestSite.Models.ServiceResponses
4+
{
5+
public class MeetupRequest
6+
{
7+
[JsonProperty("query")]
8+
public string Query { get; set; } = string.Empty;
9+
}
10+
}

examples/Umbraco.AuthorizedServices.TestSite/appsettings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,19 @@
496496
"ExchangeTokenWhenExpiresWithin": "25.00:00:00"
497497
},
498498
"RefreshAccessTokenWhenExpiresWithin": "00.00:00:40"
499+
},
500+
"meetup": {
501+
"DisplayName": "Meetup",
502+
"ApiHost": "https://api.meetup.com",
503+
"IdentityHost": "https://secure.meetup.com",
504+
"TokenHost": "https://secure.meetup.com",
505+
"RequestIdentityPath": "/oauth2/authorize",
506+
"AuthorizationUrlRequiresRedirectUrl": true,
507+
"RequestTokenPath": "/oauth2/access",
508+
"RequestTokenFormat": "FormUrlEncoded",
509+
"ClientId": "",
510+
"ClientSecret": "",
511+
"SampleRequest": "/gql"
499512
}
500513
}
501514
}

0 commit comments

Comments
 (0)