# Procourse Membership API Endpoints

**URL:** https://meta.discourse.org/t/procourse-membership-api-endpoints/128513
**Category:** Development
**Created:** [September 13, 2019, 8:51pm UTC](https://meta.discourse.org/t/procourse-membership-api-endpoints/128513 "2019-09-13T20:51:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kimardenmiller](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kimardenmiller/32/119631_2.png) [@kimardenmiller](https://meta.discourse.org/u/kimardenmiller)
#### Post date: [September 13, 2019, 8:51pm UTC](https://meta.discourse.org/t/procourse-membership-api-endpoints/128513/1 "2019-09-13T20:51:08Z")

</div>

@blake, is there an interest in PR’s for plugin endpoints (Procourse Membership in this case), e.g.:

```
  def membership_subscriptions(user_id)
    response = get("/memberships/subscriptions/#{user_id}.json")
    response[:body]
  end

```

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [September 13, 2019, 9:03pm UTC](https://meta.discourse.org/t/procourse-membership-api-endpoints/128513/2 "2019-09-13T21:03:04Z")

</div>

For the api gem? No I don’t think those should be in the core gem. I’m not sure yet about how to go about it, but I’ve thought about a way to include other gems that just add the endpoints for plugins.

I bet if you make a completely separate gem you could require the discourse\_api gem and maybe use class\_eval to add your methods?

---

<div class="post-metadata">

### Author: ![kimardenmiller](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kimardenmiller/32/119631_2.png) [@kimardenmiller](https://meta.discourse.org/u/kimardenmiller)
#### Post date: [September 16, 2019, 9:30pm UTC](https://meta.discourse.org/t/procourse-membership-api-endpoints/128513/3 "2019-09-16T21:30:19Z")

</div>

`class_eval` seems to work great. Thanks, @blake.

```
def add_momentum_api_endpoints
 DiscourseApi::Client.class_eval do
   def membership_subscriptions(user_id)
     response = get("/memberships/subscriptions/#{user_id}.json")
     response[:body]
   end
 end
end

```
