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

User/lead initiated conversation using email returns 400 bad request #341

Open
palmer-milexa opened this issue May 3, 2021 · 0 comments

Comments

@palmer-milexa
Copy link

palmer-milexa commented May 3, 2021

Version info

  • intercom-php version: 4.2
  • Intercom API version: 1.4
  • PHP version: 7.3

Expected behavior

I am trying (as per the documentation here: https://developers.intercom.com/intercom-api-reference/v1.4/reference#user-or-contact-initiated-conversation) to initiate a conversation using an email address, like so:

    $response = $client->messages->create([
        'message_type' => 'inapp',
        'body' => 'Hello....',
        'from' => [
            'type' => 'contact',
            'email' => '[email protected]',
        ]
    ]);

I am expecting this to create the conversation, as the documentation states:

"The sending user or lead is identified by their user_id, email or id values in the from field, along with a type field value of user orc contact."

Actual behavior

This returns a 400 bad request response, if 'email' is used in the from field.

Logs

PHP Fatal error: Uncaught Http\Client\Common\Exception\ClientErrorException: Bad Request in .../vendor/php-http/client-common/src/Plugin/ErrorPlugin.php:72

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

1 participant