1msg/one_msg_waba_sdk

[1MSG.IO](https://1msg.io/) is the perfect WhatsApp management tool for your business. With us you get full access to the official Whatsapp API/webhooks. Every API request must contain an Authorize HTTP header with a token. This is your channel token, which can be found in your channel project on

dev-main 2023-10-12 06:53 UTC

This package is not auto-updated.

Last update: 2024-11-21 18:34:06 UTC


README

1MSG.IO is the perfect WhatsApp management tool for your business. With us you get full access to the official Whatsapp API/webhooks.

Every API request must contain an Authorize HTTP header with a token. This is your channel token, which can be found in your channel project on your profile page. Please do not give the token to anyone or post it publicly.

The authorization token must be added to each request in the GET parameter 'token' and always passed to query string (?token={your_token}). Parameters in GET queries pass query string. Parameters in POST requests — through the JSON-encoded request body.

All 'send' methods (except /sendTemplate) will only work when the dialog session with the user is open. Some of our solutions simplify and avoid such limitations, but we urge you to pay more attention to this detail

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer run composer require 1msg/one_msg_waba_sdk:dev-main

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php

require_once(__DIR__ . '/vendor/autoload.php');

$token = 'INSERT_YOUR_TOKEN_HERE';
$instanceUrl = 'INSERT_YOUR_INSTANCE URL HERE'; // for ex: https://api.1msg.io/123123123/';
// Configure API key authorization: token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('token', $token)->setHost($instanceUrl);
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\ChannelApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->getMe();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ChannelApi->getMe: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.1msg.io/YOUR_INSTANCE_NUMBER

Models

Authorization

Authentication schemes defined for the API:

token

  • Type: API key
  • API key parameter name: token
  • Location: URL query string

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

hello@1msg.io

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 2.39.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen