Skip to content

Conversation

@aborem
Copy link
Collaborator

@aborem aborem commented Aug 19, 2025

Apologies for the long PR! More than half of it is just tests and method descriptions.

Closes #41 #54

GroupMe

  • Implements OAuth flow. Note that GroupMe doesn't require the background server (the one running pardner) to make a request to its authorization server to obtain the access token. That happens in a single request from the client.
  • Implements methods for fetching new verticals: conversations, chatbots, and blocked users.

Base Service class configuration and helper methods

  • client_secret is optional now since GroupMe doesn't use it.
  • _get_resource_from_path for passing in just the unique part of the API endpoint path (so 'users' in 'https://api.tumblr.com/v2/users', for example).
  • _build_resource_url for getting the full API endpoint URL from the unique part described in the bullet point above.
  • Updated Strava and Tumblr classes to use new helper.

Sample responses

fetch_user_data
{
 "created_at": "##########",
 "email": "***********@*****.***",
 "email_verified": "False",
 "facebook_connected": "False",
 "id": "########",
 "image_url": "*****://*.*******.***/###*###.****.########***####**###**####*#####",
 "locale": "**_**",
 "microsoft_connected": "False",
 "name": "****** *****",
 "bio": null,
 "phone_number": "+# ##########",
 "sms": "False",
 "twitter_connected": "False",
 "updated_at": "##########",
 "user_id": "########",
 "zip_code": null,
 "share_url": null,
 "share_qr_code_url": null,
 "mfa": {
  "enabled": "False",
  "channels": [
   {
    "type": "*****_******",
    "created_at": "##########"
   }
  ]
 },
 "tags": [
  "*****-**"
 ],
 "prompt_for_survey": "False",
 "show_age_gate": "False",
 "birth_date_set": "True",
 "graduation_year": "",
 "campus_profile_visibility": "*******"
}
fetch_blocked_users
[
 {
  "user_id": "########",
  "blocked_user_id": "########"
 }
]
fetch_conversations_direct
[
 {
  "created_at": "##########",
  "last_message": {
   "attachments": [
    {
     "type": "*****",
     "url": "*****://*.*******.***/###*###.***.#####****#####*#*##***#*###*###*"
    }
   ],
   "avatar_url": null,
   "conversation_id": "########+#########",
   "created_at": "##########",
   "favorited_by": [],
   "id": "##################",
   "name": "*******",
   "recipient_id": "########",
   "sender_id": "#########",
   "sender_type": "****",
   "source_guid": "**#*##*########**#####****##****",
   "text": null,
   "user_id": "#########",
   "pinned_at": null,
   "pinned_by": ""
  },
  "messages_count": "#",
  "other_user": {
   "avatar_url": "",
   "id": "#########",
   "name": "*******"
  },
  "updated_at": "##########",
  "message_deletion_period": "##########",
  "message_deletion_mode": [
   "******"
  ],
  "requires_approval": "False",
  "unread_count": null,
  "last_read_message_id": null,
  "last_read_at": null,
  "message_edit_period": "##"
 }
]
fetch_conversations_group
[
  {
    "id": "########",
    "group_id": "########",
    "name": "******+ **",
    "phone_number": "+# ##########",
    "type": "*******",
    "description": "",
    "image_url": "*****://*.*******.***/###*###.****.#**##***#***##*###**##*######***",
    "creator_user_id": "#########",
    "created_at": "##########",
    "updated_at": "##########",
    "muted_until": "############",
    "messages": {
      "count": "#####",
      "last_message_id": "##################",
      "last_message_created_at": "##########",
      "last_message_updated_at": "##########",
      "preview": {
        "nickname": "****** ******",
        "text": "*** ****! *** ****** ***** *** *** **** ******* ##-##** *** *** #-#** ***. ****** *** **** ******* ##:##-##:##** *** *** ******* ******* *** #:##-#:##** *** *******! ***** *** * **** ** *** *****!",
        "image_url": "*****://*.*******.***/####*####.****.####*#**###########*###*########",
        "attachments": [
          {
            "type": "*****",
            "user_id": "#########",
            "reply_id": "##################",
            "base_reply_id": "##################"
          }
        ]
      }
    },
    "max_members": "####",
    "theme_name": null,
    "like_icon": null,
    "requires_approval": "False",
    "show_join_question": "False",
    "join_question": null,
    "message_deletion_period": "##########",
    "message_deletion_mode": ["*****", "******"],
    "message_edit_period": "##",
    "children_count": "#",
    "share_url": "*****://*******.***/****_*****/########/**#***",
    "share_qr_code_url": "*****://*****.*******.***/**/****_*****/########/**#***/*******?*********=*****%#*%#*%#**.*******.***%#*###*###.****.#**##***#***##*###**##*######***",
    "directories": null,
    "members": [
      {
        "user_id": "########",
        "nickname": "***** ***",
        "image_url": "",
        "id": "##########",
        "muted": "False",
        "autokicked": "False",
        "roles": ["****"],
        "name": "***** ***"
      }
    ],
    "members_count": "###",
    "locations": null,
    "visibility": null,
    "category_ids": null,
    "active_call_participants": null,
    "unread_count": null,
    "last_read_message_id": null,
    "last_read_at": null
  }
]

@aborem aborem linked an issue Aug 19, 2025 that may be closed by this pull request
@aborem aborem marked this pull request as ready for review August 19, 2025 18:36
@aborem aborem requested a review from lisad August 19, 2025 18:38
from pardner.services.base import (
UnsupportedVerticalException as UnsupportedVerticalException,
)
from pardner.services.groupme import GroupMeTransferService as GroupMeTransferService
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to do 'as' if you're not renaming it ... right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set up the linter to flag unused imports, so re-exporting with the same name is communicating to the linter that it's being done intentionally (in this case, to publicly expose the class!). More info: https://docs.astral.sh/ruff/rules/unused-import/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, I did not realize that.

@aborem aborem merged commit e494b94 into main Aug 19, 2025
1 check passed
@aborem aborem deleted the aborem/groupme-oauth-and-methods branch August 19, 2025 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write methods for fetching verticals from GroupMe Write groupme oauth flow

3 participants