Get or create a direct space with another user. Currently, this method will only work if the two users are in the same company or have been in same space. If one user is an anonymous user, they must both be online in the same space.

URL Parameters

NameDescriptionLocationRequiredDefault Value
userTypeThe type of user that the direct space is being created with. 'user' or 'anonymous'.PathYes
userIdThe ID of the user.PathYes

Authentication

JwtAuthenticator, Oauth2Authenticator, AnonymousAuthenticator, ServiceAppAuthenticator

Authorization

OAuthAuthorizer and PERM_TOPIC_READ

Example Request

URL

For Production: GET https://spacesapis.avayacloud.com/api/spaces/direct/{userType}/{userId}
For Staging: GET https://loganstagingapis.esna.com/api/spaces/direct/{userType}/{userId}

Headers

Authorization: "jwt eyJhbGciOiJSUzI1NiIsIdfgdfgnR5cCI6IkpXVCJ9.eyJ1c2VyX2lkX3NpZyI6ImxPWHpxNzVzR3J3X0xwWEMyRGRMakhyYXJlWVhyTzFMdEZHZkhkOWNkTXciLCJwcm9kdWN0X3R5cGUiOiJhY2NvdW50cyIsImxhc3R1cGRhdGV0aW1lIjoiMjAxNy0wMS0zMFQxMzo1ODo0Ny4yMDYiLCJpc3MiOiJ6YW5nLmlvIiwicHVibGlja2V5aWQiOiJhZ3h6Zm05dVpYTnVZVEl3TVRSeUdnc1NEVWRLZDNSUWRXSnNhV05MWlhrdfgdWdJQ2dsUEtFakFvTSIsImV4cCI6MTQ5NTM5MTIwMywidXNlcl9pZCI6ImFneHpmbTl1WlhOdVlUSXdNVFJ5RVFzU0JGVnpaWElZZ0lEQXMtX25fUW9NIiwidmVyIjoiMi4wIn0.SqZpw1uPIebqW3qlDsm0-DWYFKEH0SgPwtD-tSESWOF-5hLkZMqJH28ooWux2S7s9riIew7pTVPnZpTgJa5zHcEAG0gXSEJVOqmpGp_4ufM8YtZoZMpBFjyAkwyAt-ILkGUYIo0GU5WyzMPLV8YLXfgdfgOgkE2MGGOajBkjPmC2Db3pA0D0M9k-21EL1gwWBC5YIq0PDAkgulegwl6khRmB8irJQ-dfg-d-KV9eYfFpsCdJKRGzSfqg"

Or

Authorization: "bearer f746696f5de4528u128ae2f274eea253e8a7943a"

Or

Authorization: "service_app eyJhbGciOiJSUzI1NiIsIdfgdfgnR5cCI6IkpXVCJ9.eyJ1c2VyX2lkX3NpZyI6ImxPWHpxNzVzR3J3X0xwWEMyRGRMakhyYXJlWVhyTzFMdEZHZkhkOWNkTXciLCJwcm9kdWN0X3R5cGUiOiJhY2NvdW50cyIsImxhc3R1cGRhdGV0aW1lIjoiMjAxNy0wMS0zMFQxMzo1ODo0Ny4yMDYiLCJpc3MiOiJ6YW5nLmlvIiwicHVibGlja2V5aWQiOiJhZ3h6Zm05dVpYTnVZVEl3TVRSeUdnc1NEVWRLZDNSUWRXSnNhV05MWlhrdfgdWdJQ2dsUEtFakFvTSIsImV4cCI6MTQ5NTM5MTIwMywidXNlcl9pZCI6ImFneHpmbTl1WlhOdVlUSXdNVFJ5RVFzU0JGVnpaWElZZ0lEQXMtX25fUW9NIiwidmVyIjoiMi4wIn0.SqZpw1uPIebqW3qlDsm0-DWYFKEH0SgPwtD-tSESWOF-5hLkZMqJH28ooWux2S7s9riIew7pTVPnZpTgJa5zHcEAG0gXSEJVOqmpGp_4ufM8YtZoZMpBFjyAkwyAt-ILkGUYIo0GU5WyzMPLV8YLXfgdfgOgkE2MGGOajBkjPmC2Db3pA0D0M9k-21EL1gwWBC5YIq0PDAkgulegwl6khRmB8irJQ-dfg-d-KV9eYfFpsCdJKRGzSfqg"

Example Response

{
    "data": [
        {
            "settings": {
                "mpaasSettings": {
                    "eventConference": {
                        "enable": false
                    },
                    "mixerMode": "OPTIMIZED_PROCESSED",
                    "maxResolution": "720P"
                },
                "mdSrv": "mpaas",
                "mdOpts": [],
                "confId": "293386225"
            },
            "type": "direct",
            "status": 0,
            "restrict": [
                "deny_guest_access_topic",
                "deny_add_member",
                "deny_add_admin"
            ],
            "_id": "5f0c28dbbb96c858ebb34c21",
            "uid": "DT_user_5eeb4e49aa4a347af9c7bd13&user_5ef48c5faa4a347af91771c3",
            "cid": "5eeb4e49aa4a347af9c7bd13",
            "members": [
                {
                    "phone_numbers": [],
                    "member": "5ef48c5faa4a347af9177...",
                    "memberType": "userId",
                    "role": "admin",
                    "joinTime": "2020-07-13T09:26:51.305Z",
                    "username": "user1@avaya.com",
                    "displayname": "Username1",
                    "picture_url": "https://accounts.zang.io/norevimages/noimage.jpg"
                },
                {
                    "phone_numbers": [],
                    "member": "5eeb4e49aa4a347af9c7b...",
                    "memberType": "userId",
                    "role": "admin",
                    "joinTime": "2020-07-13T09:26:51.305Z",
                    "username": "user2@3OfcoT5uBD.com",
                    "displayname": "Username2",
                    "picture_url": "https://storage.googleapis.com/onesna/pictures/pfpic_85c55d13-6f87-42f4-a576-c1a5a87dc..."
                }
            ],
            "created": "2020-07-13T09:26:51.317Z",
            "parents": [],
            "companies": [
                {
                    "companyid": "5697db96283a4708c4f786f6",
                    "userid": "5ef48c5faa4a347af91771c3"
                }
            ],
            "msgRetention": {
                "notInheritParentPolicy": false,
                "retentionType": "forever",
                "retentionLength": 0,
                "policy": {
                    "from": "company",
                    "retentionType": "forever",
                    "retentionLength": 0,
                    "limitCustomLength": false
                }
            }
        }
    ]
}