Skip to content

Contacts search by email address seems to have stopped working #669

@AnthonyDugarte

Description

@AnthonyDugarte

the following code seem to have stopped working. it seems a support for a formatting the lib is doing stopped working?

import { Client } from '@hubspot/api-client';

const accessToken = '...';
const email = 'email@company.org';

const client = new Client({ accessToken });

const contact = await client.crm.contacts.basicApi
            .getById(
                email,
                ['phone'],
                undefined,
                undefined,
                undefined,
                'email',
            );

this results in the error:

{
    "status": "error",
    "message": "Object not found.  objectId are usually numeric.",
    "correlationId": "...",
    "context": {
        "id": [
            "email%40company.org?properties=phone&idProperty=email"
        ]
    },
    "category": "OBJECT_NOT_FOUND"
}

doing the same in postman (without the %40 formatting of the @ that the api-client seems to be doing), it does work and results in a 200 response with the contact's data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions