Obtener info del cliente
Devuelve la informacion del cliente asociado al API key.
GET
/api/cliente_info.php
API Key
Parametros
| Nombre | Tipo | Requerido | Descripcion |
|---|---|---|---|
key |
string | Si | API key del celular |
Respuestas
200
OK
{
"ok": true,
"cliente": {
"id": 14,
"nombre": "MASH Test",
"saldo": 1500
}
}
Ejemplos de codigo
Listos para copiar y pegar. Cubre los 8 lenguajes mas usados.
<?php
// PHP + cURL
$ch = curl_init('https://api.multimensajes.com/api/cliente-info.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'key' => 'WA_8_a1b2c3d4e5f6g7h8',
]);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/x-www-form-urlencoded']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
import requests
response = requests.post(
'https://api.multimensajes.com/api/cliente-info.php',
data={
'key': 'key': 'WA_8_a1b2c3d4e5f6g7h8'
},
timeout=30
)
data = response.json()
print(data)
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
const params = new URLSearchParams();
params.append('key', 'WA_8_a1b2c3d4e5f6g7h8');
const response = await fetch('https://api.multimensajes.com/api/cliente-info.php', {
method: 'POST',
body: params
});
const data = await response.json();
console.log(data);
curl -X POST 'https://api.multimensajes.com/api/cliente-info.php' \
-d 'key=WA_8_a1b2c3d4e5f6g7h8'
package main
import (
"fmt"
"net/url"
"net/http"
"io/ioutil"
)
func main() {
form := url.Values{}
form.Add("key", "WA_8_a1b2c3d4e5f6g7h8")
resp, _ := http.PostForm("https://api.multimensajes.com/api/cliente-info.php", form)
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.OutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class WhatsAppAPI {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.multimensajes.com/api/cliente-info.php");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setDoOutput(true);
StringBuilder params = new StringBuilder();
params.append("key=WA_8_a1b2c3d4e5f6g7h8\&");
params.append("
con.getOutputStream().write(params.toString().getBytes());
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String line;
while ((line = in.readLine()) != null) System.out.println(line);
}
}
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.multimensajes.com/api/cliente-info.php')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Post.new(uri.path)
req.set_form_data(
'key' => 'WA_8_a1b2c3d4e5f6g7h8'
)
response = http.request(req)
puts JSON.parse(response.body)
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Collections.Generic;
class Program {
static async Task Main() {
var client = new HttpClient();
var form = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("key", "WA_8_a1b2c3d4e5f6g7h8")
});
var response = await client.PostAsync("https://api.multimensajes.com/api/cliente-info.php", form);
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
Pruebalo tu mismo
Copia este comando y pegalo en tu terminal (necesitas curl):
curl -X POST 'https://api.multimensajes.com/api/cliente-info.php' \
-d 'key=WA_8_a1b2c3d4e5f6g7h8'