Giter VIP home page Giter VIP logo

Comments (2)

saranshdhingra avatar saranshdhingra commented on August 17, 2024

Hi @lekiend
The error that you have mentioned seems like an incorrect people resource name.

I tried the code snippet as such:

function addPersonInExistingHangoutSpace($client) {
    $userId = ""; // people resource id like 100000033......
    $service = new HangoutsChat($client);
    $space = new Google\Service\HangoutsChat\Space(["displayName" => "My space", "spaceType" => "SPACE"]);
    $membership1 = new Google\Service\HangoutsChat\Membership(["member" => ["name" => "users/$userId", "type" => "HUMAN"]] );
    $SetUpSpaceRequest = new Google\Service\HangoutsChat\SetUpSpaceRequest(["space" => $space, "memberships" => [$membership1]]);
    $space = $service->spaces->setup( $SetUpSpaceRequest );
}

This created the space and added the person to space.

One thing to note here is that the user is in my contacts. Please confirm if this is the case or not.

from google-api-php-client-services.

lekiend avatar lekiend commented on August 17, 2024

Hello,

In the first part of my code, $resourceName is returned correctly. I just replace "people" with "users" to fit the documentation.
Anyway, I discover that it is possible only with internal users. It is not possible to use the Chat API with external users.

Because of those restrictions, I moved to Telegram chat with less restrictions and a lot easier to use.

Regards

from google-api-php-client-services.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.