Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating Notes with Engagements results in "metadata cannot be null" #362

Closed
MCKLtech opened this issue Oct 28, 2021 · 1 comment
Closed

Comments

@MCKLtech
Copy link

MCKLtech commented Oct 28, 2021

We've hitting the following error when creating a note via the engagement end point:

Client error: POST https://api.hubapi.com/engagements/v1/engagements resulted in a 400 Bad Request response:
{"status":"error","message":"metadata cannot be null","correlationId":"XYZ}

Example Code:

$engagement = [
            "active" => true,
            "type" => "NOTE",
            "timestamp" => time() * 1000
        ];

        $assoc = [];
        $assoc[] = ["contactIds" => [123456]];

$note = $this->client->engagements()->create($engagement, $assoc, ["body" => "My note is here"])->getData();

@ksvirkou-hubspot
Copy link
Collaborator

Hi @MCKLtech
Below workable example

$engagement = [
    "active" => true,
    "type" => "NOTE",
    "timestamp" => time() * 1000
];

$assoc = [];
$assoc['contactIds'] = [8451];

$note = $hubSpot->engagements()->create($engagement, $assoc, ["body" => "My note is here"]);

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

No branches or pull requests

2 participants