Skip to main content

Nexconn Server API

Project description

nexconn-sdk-python

Nexconn Server API

  • API version: 0.1.0
    • Generator version: 7.14.0

OpenAPI specification aligned with the current Nexconn public documentation, PDF source documents, and generated SDK requirements.

Automatically generated by the OpenAPI Generator

Requirements

  • Python 3.8+ (requires installing package dependencies such as pydantic)

Installation

pip install "git+https://github.com/NexconnAI-Dev/nexconn-server-sdk-python.git@v0.1.0"

If you publish releases later, prefer installing a tagged version instead of tracking a branch.

Then import the package:

import ncsdk

Quick Start

The example below uses the SDK's built-in signing support to inject App-Key / Nonce / Timestamp / Signature / X-Request-ID automatically.

import os
import ncsdk
from ncsdk.models.access_token_issue_request import AccessTokenIssueRequest
from ncsdk.exceptions import ApiException

configuration = ncsdk.Configuration()
configuration.set_nexconn_credentials(
    app_key="YOUR_APP_KEY",
    app_secret="YOUR_APP_SECRET",
)

# Optional: override the default nonce generator.
# configuration.set_nonce_generator(lambda: "custom-nonce")

# Required: configure primary/backup domains before sending requests.
configuration.set_primary_backup_domains(
    os.environ["NEXCONN_PRIMARY_API_DOMAIN"],
    os.environ["NEXCONN_SECONDARY_API_DOMAIN"],
)
# configuration.server_index = 0
# configuration.set_error_switching_threshold(1)
# configuration.set_auto_failover_enabled(True)

with ncsdk.ApiClient(configuration) as api_client:
    user_management_api = ncsdk.UserManagementApi(api_client)
    request = AccessTokenIssueRequest(
        user_id="user_123",
        name="Alice",
        avatar_url="https://example.com/avatar.png",
    )

    try:
        response = user_management_api.issue_access_token(request)
        print(response)
    except ApiException as exc:
        print(f"Request failed: {exc}")

Error Handling

The SDK raises typed ApiException subclasses based on the HTTP status code. Each exception automatically parses the response body to expose the business error_code and error_message.

from ncsdk.exceptions import (
    ApiException,
    BadRequestException,
    UnauthorizedException,
    ForbiddenException,
    NotFoundException,
    ConflictException,
    TooManyRequestsException,
    ServiceException,
)

try:
    response = group_api.create_group(request)
except BadRequestException as e:
    # HTTP 400 — invalid parameters
    print(f"Bad request: {e.error_code} {e.error_message}")
except UnauthorizedException as e:
    # HTTP 401 — check your AppKey / AppSecret
    pass
except ForbiddenException as e:
    # HTTP 403 — permission denied
    pass
except NotFoundException as e:
    # HTTP 404 — resource not found
    pass
except ConflictException as e:
    # HTTP 409 — resource already exists
    print(f"Conflict: error_code={e.error_code}")
except TooManyRequestsException as e:
    # HTTP 429 — rate limited, retry later
    pass
except ServiceException as e:
    # HTTP 5xx — server error, may retry
    pass
except ApiException as e:
    # Other HTTP errors
    print(f"HTTP {e.status}: {e.body}")

All exception subclasses provide the following attributes:

Attribute Description
status HTTP status code
error_code Business error code from response body code field (-1 if unparseable)
error_message Business error message from response body errorMessage field
body Raw response body string
headers Response headers

Features

  • Automatic Nexconn request signing when set_nexconn_credentials() is configured
  • Built-in multi-domain failover support via set_primary_backup_domains()
  • Default User-Agent: nexconn-sdk-python/0.1.0
  • Automatic X-Request-ID generation

Documentation for API Endpoints

All requests use the primary/backup domains configured by the caller.

Class Method HTTP request Description
ChannelManagementApi add_tag_to_channels POST /v4/channel/tag/add Add tag to channel
ChannelManagementApi add_user_channel_tags POST /v4/user/channel/tag/add Add user channel tag
ChannelManagementApi get_channel_attribute POST /v4/channel/attribute/get Get channel attributes
ChannelManagementApi get_channel_push_notification POST /v4/channel/push/get Get channel DND
ChannelManagementApi get_channel_type_notification POST /v4/channel-type/push/get Get DND by channel type
ChannelManagementApi list_channels_by_tag POST /v4/channel/tag/list Get channels by tag
ChannelManagementApi list_user_channel_tags POST /v4/user/channel/tag/list List user channel tags
ChannelManagementApi remove_tag_from_channels POST /v4/channel/tag/delete Remove tag from channel
ChannelManagementApi remove_user_channel_tags POST /v4/user/channel/tag/remove Remove user channel tag
ChannelManagementApi set_channel_pin POST /v4/channel/pin/set Pin a channel
ChannelManagementApi set_channel_push_notification POST /v4/channel/push/set Set channel DND
ChannelManagementApi set_channel_type_notification POST /v4/channel-type/push/set Set DND by channel type
CommunityChannelManagementApi add_community_channel_user_group_users POST /v4/community-channel/user-group/user/add Add community channel user group users
CommunityChannelManagementApi add_community_channel_user_groups POST /v4/community-channel/user-group/add Add community channel user groups
CommunityChannelManagementApi add_private_subchannel_members POST /v4/community-channel/private-subchannel/member/add Add private subchannel members
CommunityChannelManagementApi bind_community_channel_user_group POST /v4/community-channel/channel/user-group/bind Bind community channel user group
CommunityChannelManagementApi check_community_channel_member_exist POST /v4/community-channel/member/exist Check community channel member exist
CommunityChannelManagementApi create_community_channel POST /v4/community-channel/create Create community channel
CommunityChannelManagementApi create_community_subchannel POST /v4/community-channel/subchannel/create Create community subchannel
CommunityChannelManagementApi delete_community_subchannel POST /v4/community-channel/subchannel/delete Delete community subchannel
CommunityChannelManagementApi dismiss_community_channel POST /v4/community-channel/dismiss Dismiss community channel
CommunityChannelManagementApi join_community_channel POST /v4/community-channel/join Join community channel
CommunityChannelManagementApi list_community_channel_history_messages POST /v4/community-channel/history-message/list List community-channel history messages
CommunityChannelManagementApi list_community_channel_subchannel_user_groups POST /v4/community-channel/channel/user-group/list List community channel subchannel user groups
CommunityChannelManagementApi list_community_channel_user_group_subchannels POST /v4/community-channel/user-group/subchannel/list List community channel user group subchannels
CommunityChannelManagementApi list_community_channel_user_groups POST /v4/community-channel/user-group/list List community channel user groups
CommunityChannelManagementApi list_community_channel_user_user_groups POST /v4/community-channel/user/user-group/list List community channel user user groups
CommunityChannelManagementApi list_community_subchannels POST /v4/community-channel/subchannel/list List community subchannels
CommunityChannelManagementApi list_community_user_subchannels POST /v4/community-channel/user/subchannel/list List community user subchannels
CommunityChannelManagementApi list_private_subchannel_members POST /v4/community-channel/private-subchannel/member/list List private subchannel members
CommunityChannelManagementApi quit_community_channel POST /v4/community-channel/leave Leave community channel
CommunityChannelManagementApi remove_community_channel_user_group_users POST /v4/community-channel/user-group/user/remove Remove community channel user group users
CommunityChannelManagementApi remove_community_channel_user_groups POST /v4/community-channel/user-group/remove Delete community channel user groups
CommunityChannelManagementApi remove_private_subchannel_members POST /v4/community-channel/private-subchannel/member/remove Remove private subchannel members
CommunityChannelManagementApi unbind_community_channel_user_group POST /v4/community-channel/channel/user-group/unbind Unbind community channel user group
CommunityChannelManagementApi update_community_channel_info POST /v4/community-channel/update Update community channel info
CommunityChannelManagementApi update_community_subchannel_type POST /v4/community-channel/subchannel-type/update Update community subchannel type
CommunityChannelModerationApi add_community_channel_allowed_sender_list POST /v4/community-channel/allowed-sender-list/add Add community channel allowed sender list
CommunityChannelModerationApi add_community_channel_muted_users POST /v4/community-channel/mute-list/add Add community-channel muted users
CommunityChannelModerationApi get_community_channel_freeze_list POST /v4/community-channel/freeze-list/get Get community channel freeze status
CommunityChannelModerationApi list_community_channel_allowed_sender_list POST /v4/community-channel/allowed-sender-list/get List community channel allowed sender list
CommunityChannelModerationApi list_community_channel_muted_users POST /v4/community-channel/mute-list/get List community-channel muted users
CommunityChannelModerationApi remove_community_channel_allowed_sender_list POST /v4/community-channel/allowed-sender-list/remove Remove community channel allowed sender list
CommunityChannelModerationApi remove_community_channel_muted_users POST /v4/community-channel/mute-list/remove Remove community-channel muted users
CommunityChannelModerationApi set_community_channel_freeze_list POST /v4/community-channel/freeze-list/set Set community channel freeze list
FriendshipApi add_friend POST /v4/friend/add Add friend
FriendshipApi get_friend_permission POST /v4/friend/permission/get Get friend permission
FriendshipApi get_friend_relationships POST /v4/friend/relationship/get Get friend relationships
FriendshipApi list_friends POST /v4/friend/list List friends
FriendshipApi remove_all_friends POST /v4/friend/remove-all Clean all friends
FriendshipApi remove_friends POST /v4/friend/remove Delete friends
FriendshipApi set_friend_permission POST /v4/friend/permission/set Set friend permission
FriendshipApi set_friend_profile POST /v4/friend/profile/set Set friend profile
GroupChannelManagementApi add_group_channel_admins POST /v4/group-channel/admin/add Add group admins
GroupChannelManagementApi add_group_channel_member_favorites POST /v4/group-channel/member/favorites/add Add favorite group members
GroupChannelManagementApi batch_get_group_channel_members POST /v4/group-channel/member/batch/get Get specific group members
GroupChannelManagementApi batch_get_group_channel_profiles POST /v4/group-channel/profile/list List group profiles
GroupChannelManagementApi create_group_channel POST /v4/group-channel/create Create a group
GroupChannelManagementApi delete_group_channel_alias POST /v4/group-channel/alias/delete Delete group alias
GroupChannelManagementApi dismiss_group_channel POST /v4/group-channel/dismiss Dismiss a group
GroupChannelManagementApi get_group_channel_alias POST /v4/group-channel/alias/get Get group alias
GroupChannelManagementApi join_group_channel POST /v4/group-channel/join Join a group
GroupChannelManagementApi kick_user_from_all_group_channels POST /v4/group-channel/member/kickout-all Remove a user from all groups
GroupChannelManagementApi list_group_channel_member_favorites POST /v4/group-channel/member/favorites/list List favorite group members
GroupChannelManagementApi list_group_channel_members POST /v4/group-channel/member/list Query group members
GroupChannelManagementApi list_group_channels POST /v4/group-channel/list List group channels
GroupChannelManagementApi list_user_joined_group_channels POST /v4/group-channel/joined/list Query user's groups
GroupChannelManagementApi quit_group_channel POST /v4/group-channel/leave Leave a group
GroupChannelManagementApi remove_group_channel_admins POST /v4/group-channel/admin/remove Remove group admins
GroupChannelManagementApi remove_group_channel_member_favorites POST /v4/group-channel/member/favorites/remove Remove favorite group members
GroupChannelManagementApi set_group_channel_alias POST /v4/group-channel/alias/set Set group alias
GroupChannelManagementApi set_group_channel_member POST /v4/group-channel/member/set Set group member profile
GroupChannelManagementApi transfer_group_channel_owner POST /v4/group-channel/transfer/owner Transfer group ownership
GroupChannelManagementApi update_group_channel_profile POST /v4/group-channel/profile/update Update group info
GroupChannelModerationApi add_group_channel_allowed_sender_list POST /v4/group-channel/allowed-sender-list/add Add to allowed senders list
GroupChannelModerationApi add_group_channel_freeze_list POST /v4/group-channel/freeze-list/add Freeze a group
GroupChannelModerationApi add_group_channel_user_mute_list POST /v4/group-channel/user/mute-list/add Mute a group member
GroupChannelModerationApi get_group_channel_allowed_sender_list POST /v4/group-channel/allowed-sender-list/get Query allowed senders list
GroupChannelModerationApi get_group_channel_freeze_list POST /v4/group-channel/freeze-list/get Query group freeze status
GroupChannelModerationApi get_group_channel_user_mute_list POST /v4/group-channel/user/mute-list/get List muted group members
GroupChannelModerationApi remove_group_channel_allowed_sender_list POST /v4/group-channel/allowed-sender-list/remove Remove from allowed senders list
GroupChannelModerationApi remove_group_channel_freeze_list POST /v4/group-channel/freeze-list/remove Unfreeze a group
GroupChannelModerationApi remove_group_channel_user_mute_list POST /v4/group-channel/user/mute-list/remove Unmute a group member
MessageManagementApi broadcast_open_channel_message POST /v4/open-channel/message/broadcast Broadcast to all open channels
MessageManagementApi delete_channel_message_history POST /v4/channel/message/history/delete Delete server-side channel message history
MessageManagementApi delete_channel_type_message_metadata POST /v4/channel-type/message/metadata/delete Delete message metadata
MessageManagementApi delete_community_channel_message_metadata POST /v4/community-channel/message/metadata/delete Delete community-channel message metadata keys
MessageManagementApi delete_message POST /v4/message/delete Delete a message (recall)
MessageManagementApi list_channel_type_message_metadata POST /v4/channel-type/message/metadata/list Get message metadata
MessageManagementApi list_community_channel_message_metadata POST /v4/community-channel/message/metadata/list List community-channel message metadata
MessageManagementApi send_community_channel_message POST /v4/community-channel/message/send Send a community channel message
MessageManagementApi send_direct_channel_message POST /v4/direct-channel/message/send Send a direct message
MessageManagementApi send_group_channel_message POST /v4/group-channel/message/send Send a group message
MessageManagementApi send_open_channel_message POST /v4/open-channel/message/send Send an open channel message
MessageManagementApi set_channel_type_message_metadata POST /v4/channel-type/message/metadata/set Set message metadata
MessageManagementApi set_community_channel_message_metadata POST /v4/community-channel/message/metadata/set Set community-channel message metadata
MessageManagementApi update_community_channel_message POST /v4/community-channel/message/update Update community-channel message
MessageManagementApi update_direct_channel_message POST /v4/direct-channel/message/update Update direct-channel message
MessageManagementApi update_group_channel_message POST /v4/group-channel/message/update Update group-channel message
ModerationApi batch_add_profanity_words POST /v4/profanity-word/batch/add Batch add profanity words
ModerationApi batch_remove_profanity_words POST /v4/profanity-word/batch/remove Batch delete profanity words
ModerationApi list_profanity_words POST /v4/profanity-word/list List profanity words
ModerationApi remove_profanity_word POST /v4/profanity-word/remove Delete profanity word
OpenChannelManagementApi create_open_channel POST /v4/open-channel/create Create an open channel
OpenChannelManagementApi destroy_open_channels POST /v4/open-channel/destroy Destroy an open channel
OpenChannelManagementApi get_open_channel POST /v4/open-channel/get Get open channel info
OpenChannelManagementApi set_open_channel_destroy_type POST /v4/open-channel/destroy-type/set Set auto-destroy type
OpenChannelMessagePriorityApi add_open_channel_low_priority_message_type_list POST /v4/open-channel/low-priority-message-type-list/add Add low-priority message types
OpenChannelMessagePriorityApi get_open_channel_low_priority_message_type_list POST /v4/open-channel/low-priority-message-type-list/get Query low-priority message types
OpenChannelMessagePriorityApi remove_open_channel_low_priority_message_type_list POST /v4/open-channel/low-priority-message-type-list/remove Remove low-priority message types
OpenChannelMetadataApi batch_get_open_channel_metadata POST /v4/open-channel/metadata/batch/get Query metadata
OpenChannelMetadataApi batch_remove_open_channel_metadata POST /v4/open-channel/metadata/batch/remove Batch delete metadata
OpenChannelMetadataApi batch_set_open_channel_metadata POST /v4/open-channel/metadata/batch/set Batch set metadata
OpenChannelParticipantsModerationApi add_open_channel_freeze_list POST /v4/open-channel/freeze-list/add Freeze an open channel
OpenChannelParticipantsModerationApi add_open_channel_global_mute_list POST /v4/open-channel/global-mute-list/add Mute a user globally
OpenChannelParticipantsModerationApi add_open_channel_participant_allowed_sender_list POST /v4/open-channel/participant/allowed-sender-list/add Add to allowed senders list
OpenChannelParticipantsModerationApi add_open_channel_participant_ban_list POST /v4/open-channel/participant/ban-list/add Ban a participant
OpenChannelParticipantsModerationApi add_open_channel_participant_mute_list POST /v4/open-channel/participant/mute-list/add Mute a participant
OpenChannelParticipantsModerationApi check_open_channel_freeze POST /v4/open-channel/freeze/check Check open channel freeze status
OpenChannelParticipantsModerationApi check_open_channel_participants_exist POST /v4/open-channel/participant/exist Batch check participants
OpenChannelParticipantsModerationApi get_open_channel_global_mute_list POST /v4/open-channel/global-mute-list/get List globally muted users
OpenChannelParticipantsModerationApi get_open_channel_participant_allowed_sender_list POST /v4/open-channel/participant/allowed-sender-list/get Query allowed senders list
OpenChannelParticipantsModerationApi get_open_channel_participant_ban_list POST /v4/open-channel/participant/ban-list/get List banned participants
OpenChannelParticipantsModerationApi get_open_channel_participant_mute_list POST /v4/open-channel/participant/mute-list/get List muted participants
OpenChannelParticipantsModerationApi list_frozen_open_channels POST /v4/open-channel/freeze-list/get List frozen open channels
OpenChannelParticipantsModerationApi list_open_channel_participants POST /v4/open-channel/participant/list List participants
OpenChannelParticipantsModerationApi remove_open_channel_freeze_list POST /v4/open-channel/freeze-list/remove Unfreeze an open channel
OpenChannelParticipantsModerationApi remove_open_channel_global_mute_list POST /v4/open-channel/global-mute-list/remove Unmute a user globally
OpenChannelParticipantsModerationApi remove_open_channel_participant_allowed_sender_list POST /v4/open-channel/participant/allowed-sender-list/remove Remove from allowed senders list
OpenChannelParticipantsModerationApi remove_open_channel_participant_ban_list POST /v4/open-channel/participant/ban-list/remove Unban a participant
OpenChannelParticipantsModerationApi remove_open_channel_participant_mute_list POST /v4/open-channel/participant/mute-list/remove Unmute a participant
OpenChannelPriorityControlsApi add_open_channel_priority_message_type_list POST /v4/open-channel/priority-message-type-list/add Add priority message types
OpenChannelPriorityControlsApi add_open_channel_priority_sender_list POST /v4/open-channel/priority-sender-list/add Add priority senders
OpenChannelPriorityControlsApi get_open_channel_priority_message_type_list POST /v4/open-channel/priority-message-type-list/get Query priority message types
OpenChannelPriorityControlsApi get_open_channel_priority_sender_list POST /v4/open-channel/priority-sender-list/get Query priority senders
OpenChannelPriorityControlsApi remove_open_channel_priority_message_type_list POST /v4/open-channel/priority-message-type-list/remove Remove priority message types
OpenChannelPriorityControlsApi remove_open_channel_priority_sender_list POST /v4/open-channel/priority-sender-list/remove Remove priority senders
SystemMessagesApi broadcast_message_online POST /v4/system-channel/message/broadcast-online Broadcast to online users
SystemMessagesApi broadcast_system_channel_message POST /v4/system-channel/message/broadcast-all Broadcast to all users (persistent)
SystemMessagesApi delete_broadcast_message POST /v4/system-channel/message/broadcast/delete Recall broadcast to all users
SystemMessagesApi send_system_channel_message POST /v4/system-channel/message/send Send a system message
SystemMessagesApi send_system_channel_push_by_package POST /v4/system-channel/app-package-users/send Push by app package name
SystemMessagesApi send_system_channel_push_by_tag POST /v4/system-channel/tagged-users/send Push to tagged users
UserBlocklistApi add_user_blocklist POST /v4/user/blocklist/add Add to blocklist
UserBlocklistApi get_user_blocklist POST /v4/user/blocklist/get Get blocklist
UserBlocklistApi remove_user_blocklist POST /v4/user/blocklist/remove Remove from blocklist
UserManagementApi ban_users POST /v4/user/ban Ban a user
UserManagementApi batch_get_user_tags POST /v4/user/tag/batch/get Get user tags
UserManagementApi batch_set_user_tags POST /v4/user/tag/batch/set Batch set user tags
UserManagementApi expire_access_token POST /v4/auth/access-token/expire Expire an access token
UserManagementApi get_user POST /v4/user/get Get user info
UserManagementApi get_user_connection_status POST /v4/user/connection-status/get Check user online status
UserManagementApi issue_access_token POST /v4/auth/access-token/issue Register a user
UserManagementApi list_banned_users POST /v4/user/ban/list List banned users
UserManagementApi list_channel_type_mute POST /v4/channel-type/mute/list List muted direct channel users
UserManagementApi list_soft_deleted_users POST /v4/user/soft-deleted/list Query soft-deleted users
UserManagementApi restore_users POST /v4/user/restore Restore a user
UserManagementApi set_channel_type_mute POST /v4/channel-type/mute/set Mute a user in direct channels
UserManagementApi soft_delete_users POST /v4/user/soft-delete Soft-delete a user
UserManagementApi unban_users POST /v4/user/unban Unban a user
UserManagementApi update_user POST /v4/user/update Update user info
UserProfileHostingApi batch_get_user_profiles POST /v4/user/profile/batch/get Batch get user profiles
UserProfileHostingApi delete_user_profiles POST /v4/user/profile/delete Clear user profiles
UserProfileHostingApi list_user_profiles POST /v4/user/profile/list List user profiles
UserProfileHostingApi set_user_profile POST /v4/user/profile/set Set user profile

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

NexconnSignature

  • Type: API key
  • API key parameter name: App-Key
  • Location: HTTP header

Package Info

  • Repository: https://github.com/NexconnAI-Dev/nexconn-server-sdk-python
  • Package version: 0.1.0

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ncsdk-0.1.0.tar.gz (188.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ncsdk-0.1.0-py3-none-any.whl (532.9 kB view details)

Uploaded Python 3

File details

Details for the file ncsdk-0.1.0.tar.gz.

File metadata

  • Download URL: ncsdk-0.1.0.tar.gz
  • Upload date:
  • Size: 188.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.5

File hashes

Hashes for ncsdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9a8c052ee3b20207c900e3c33f5248b04ce89a2093c22338a372902a5e868105
MD5 37038ac3c035c8e09c9669a130f387e1
BLAKE2b-256 b7759a28f5960bd69a2fad7438750d08f2ccfbd6f9d3f1a074a04ef0f79524df

See more details on using hashes here.

File details

Details for the file ncsdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ncsdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 532.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.5

File hashes

Hashes for ncsdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 914fc7140bf5397964e2874e7c574bb77a856faaf4cec73445720b5c705c0a0b
MD5 1f2e522a48c6cde79cdd8776db95ca05
BLAKE2b-256 2913b6c4a72b06b240d37b10d4bbfe17d148e1e05f80e29e8258a74bc52148a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page