Skip to content

400 Bad Request: Validation Failed when sending message #1

@andydean565

Description

@andydean565

when using the example provided in the readme but changing the number out for my own "+447*********" (UK) I'm getting a 400 bad request with the following content.

[400] Client error: `POST https://rest.textmagic.com/api/v2/messages` resulted in a `400 Bad Request` response:
{"code":400,"message":"Validation Failed","errors":{"fields":{"destination":["Choose a valid destination type, allowed [ (truncated...)

here is the code I'm using to send the message and have done the ping before on the codebase which printed "accepted"

 try {
            $input = new SendMessageInputObject();
            $input->setText('Your activation code is 000000');
            $input->setPhones('+447*********');
            $TextMessage = $this->text->sendMessage($input);

            if($TextMessage){
              return true;
            } else {
              return false;
            }
        }
        catch (\Exception $e) {
          print($e->getMessage());
          return false;
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions