TechStacks!

<back to all web services

GetUserOrganizations

Posts
Requires Authentication
The following routes are available for this service:
All Verbs/user/organizations
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OrganizationMember:
    id: int = 0
    organization_id: int = 0
    user_id: int = 0
    user_name: Optional[str] = None
    is_owner: bool = False
    is_moderator: bool = False
    deny_all: bool = False
    deny_posts: bool = False
    deny_comments: bool = False
    notes: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OrganizationMemberInvite:
    id: int = 0
    organization_id: int = 0
    user_id: int = 0
    user_name: Optional[str] = None
    dismissed: Optional[datetime.datetime] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OrganizationSubscription:
    id: int = 0
    organization_id: int = 0
    user_id: int = 0
    user_name: Optional[str] = None
    post_types: Optional[List[str]] = None
    frequency_days: Optional[int] = None
    last_synced_id: Optional[int] = None
    last_synced: Optional[datetime.datetime] = None
    created: datetime.datetime = datetime.datetime(1, 1, 1)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetUserOrganizationsResponse:
    members: Optional[List[OrganizationMember]] = None
    member_invites: Optional[List[OrganizationMemberInvite]] = None
    subscriptions: Optional[List[OrganizationSubscription]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetUserOrganizations(IGet):
    pass

Python GetUserOrganizations DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /user/organizations HTTP/1.1 
Host: techstacks.io 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"members":[{"id":0,"organizationId":0,"userId":0,"userName":"String","isOwner":false,"isModerator":false,"denyAll":false,"denyPosts":false,"denyComments":false,"notes":"String"}],"memberInvites":[{"id":0,"organizationId":0,"userId":0,"userName":"String","dismissed":"0001-01-01T00:00:00.0000000"}],"subscriptions":[{"id":0,"organizationId":0,"userId":0,"userName":"String","postTypes":["String"],"frequencyDays":0,"lastSyncedId":0,"lastSynced":"0001-01-01T00:00:00.0000000","created":"0001-01-01T00:00:00.0000000"}]}