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-04-25 15:59:34 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

Class Method HTTP request Description
ChannelApi getCommerce GET /commerce Get Commerce Settings
ChannelApi getExtendedStatistics GET /extendedStatistics Get Extended Channel statistics
ChannelApi getMe GET /me Get Profile Info
ChannelApi getSettings GET /settings Get Settings
ChannelApi getStatistics GET /statistics Get Channel statistics
ChannelApi getStatus GET /status Get Status
ChannelApi outputIP GET /outputIP Get channel server IP
ChannelApi setMe POST /me Change user info
ChannelApi setSettings POST /settings Set settings
MediaApi uploadMedia POST /uploadMedia Upload media & get mediaId
MessagingApi messagesList GET /messages Get messages list
MessagingApi readMessage POST /readMessage Mark message as read
MessagingApi sendContact POST /sendContact Send a Contact
MessagingApi sendFile POST /sendFile Send a File
MessagingApi sendList POST /sendList Send List Message
MessagingApi sendLocation POST /sendLocation Send a Location
MessagingApi sendMessage POST /sendMessage Send a Message
ProductsCatalogsApi sendProduct POST /sendProduct Send a Product
ProductsCatalogsApi setCommerce POST /commerce Set Commerce Settings
TemplatesApi addTemplate POST /addTemplate Create template
TemplatesApi removeTemplate POST /removeTemplate Remove template
TemplatesApi sendTemplate POST /sendTemplate Send Template Message
TemplatesApi templatesList GET /templates Get templates list
WebhooksApi ackHookInfo GET /hookInfo Check ACKs
WebhooksApi setWebhook POST /webhook Set webhook

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