+90 (216) 222 25 25

FaxMAX API

FaxMAX

Hesap DID(Telf.No) İşlemleri


Baz Metod
 Core.account_dids
Tüm Metodlar
MetodAçıklama
Core.account_dids.comboÖzet liste döner(ComboBox'larda kullanmak için).
Core.account_didsTam liste olarak döner(Tablolarda kullanmak için).
Core.account_dids.editVar olan kaydı güncelleme içindir.
Core.account_dids.createYeni kayıt eklemek içindir.
Core.account_dids.removeKaydı silmek içindir.

Core.account_dids.combo

JSON olarak şu şekilde bilgiler gönderilir:
{
    "jsonrpc":"2.0",
    "id":"fe012e8c-2d2f-47da-b7bb-9d90ee611eb4",
    "method":"Core.account_dids.combo",
    "params":{
        "token_":[TOKEN],
        "user_id": Login'de dönen kullanıcı kodu
    }
}

Yukarıdaki JSON Verisini(string olarak) aşağıdaki şekilde gönderebilirsiniz:

 
curl -s -k -i -X POST -F data=JSON VERİSİ 'https://DOMAIN/api/v1'
         
 import json
import requests
r = requests.post('https://DOMAIN/api/v1',
                  data={'data': JSON VERİSİ}, verify=False)
print r.status_code, r.text
             
 $ch = curl_init();
curl_setopt_array($ch, array(
    CURLOPT_URL => "https://DOMAIN/api/v1",
    CURLOPT_HEADER => true,
    CURLOPT_POST => 1,
    CURLOPT_POSTFIELDS => array( "data" => JSON VERİSİ )) ), CURLOPT_RETURNTRANSFER => true ));
$result = curl_exec($ch);
curl_close($ch);
echo $result;  
 private async void Button_Click(object sender, RoutedEventArgs e)
{
    HttpStringContent stringContent = new HttpStringContent( JSON VERİSİ,
        UnicodeEncoding.Utf8, "application/json");
    HttpClient client = new HttpClient();
    HttpResponseMessage response = await client.PostAsync( "https://DOMAIN/api/v1", stringContent);
    string responseBody = await response.Content.ReadAsStringAsync();
    Console.WriteLine (responseBody);
}
 
 import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.EntityUtils;
import java.io.File;
import org.apache.http.conn.ssl.*;
import org.apache.http.impl.client.*;
import java.security.cert.X509Certificate;
import java.security.cert.CertificateException;
import org.apache.http.conn.scheme.*;
import org.apache.http.impl.conn.tsccm.*;
import org.apache.http.conn.*;

//export CLASSPATH=./httpcomponents-client-4.5.1/lib/*:.

public class ApiSendFax {
	public static void main(String[] args) throws Exception {
        /* Patch ssl hostname validation */
        SSLSocketFactory sf = new SSLSocketFactory(new TrustStrategy(){
            @Override
            public boolean isTrusted(X509Certificate[] chain,
                    String authType) throws CertificateException {
                return true;
            }
        }, new AllowAllHostnameVerifier());

        SchemeRegistry registry = new SchemeRegistry();
        registry.register(new Scheme("https",8444, sf));
        ClientConnectionManager ccm = new ThreadSafeClientConnManager(registry);
        /* end of patch */

        CloseableHttpClient httpclient =  new DefaultHttpClient(ccm);
        try {
            HttpPost httppost = new HttpPost("https://DOMAIN/api/v1");
            httppost.setEntity(new StringEntity(JSON VERİSİ, ContentType.create("application/json")));
            CloseableHttpResponse response = httpclient.execute(httppost);
            try {
                System.out.println(response.getStatusLine());
                HttpEntity resEntity = response.getEntity();
                if (resEntity != null) {
                    System.out.println("Response content length: " + resEntity.getContentLength());
                }
                EntityUtils.consume(resEntity);
            } finally {
                response.close();
            }
        } finally {
            httpclient.close();
        }
    }
}
 
 $.ajax({
    async: true,
    type: 'POST',
    dataType: 'json',
    url: "https://DOMAIN/api/v1",
    data: JSON VERİSİ,
    cache: false,
    success: function(data, textStatus, jqXHR){
        console.log(data.result);
    },
    // JSON-RPC Server could return non-200 on error
    error: function(jqXHR, textStatus, errorThrown){
    }
});
 
 func main() {
    var jsonStr = []byte(JSON VERİSİ)
    req, err := http.NewRequest("POST", "https://DOMAIN/api/v1", bytes.NewBuffer(jsonStr))
    req.Header.Set("Content-Type", "application/json")
    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()
    fmt.Println("response Status:", resp.Status)
    fmt.Println("response Headers:", resp.Header)
    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println("response Body:", string(body))
} 

JSON params içeriği
Parametre Zorunlu? Açıklama
token* Evet** Giriş için kullanılacak TOKEN bilgisi
* TOKEN yerine username ve password bilgileri gönderilebilir.
** Eğer username ve password belirtilmemiş ise TOKEN mutlaka belirtilmelidir.
account_id Hayır Login'de dönen hesap ID'si. Eğer gönderilmez ise veya boş olursa, aktif hesap ID'si kullanılır(Fax.accounts->view) hakkınız var ise).

Core.account_dids

JSON params içeriği
Parametre Zorunlu? Açıklama
token* Evet** Giriş için kullanılacak TOKEN bilgisi
* TOKEN yerine username ve password bilgileri gönderilebilir.
** Eğer username ve password belirtilmemiş ise TOKEN mutlaka belirtilmelidir.
account_id Hayır Login'de dönen kullanıcının hesap ID'si. Eğer gönderilmez ise veya boş olursa, aktif hesap ID'si kullanılır(Fax.accounts->view) hakkınız var ise).
page_length Evet Dönülecek kayıt sayısı(sayfa uzunluğu)
start Evet Kaçıncı satırdan itibaren kayıtlar gelsin?
order_by Evet Sıralama hangi sütuna göre yapılsın?
order_dir Evet Sondan başa (DESC) mı, yoksa baştan sona doğru(ASC) mu olsun?
search Evet did sütunu içinde geçen bir değeri aramak için kullanılabilir. Eğer arama yapılmayacaksa boş string gönderilmeli
flt Evet assigned_on sütunu için filtreleme amaçlı olarak kullanılabilir. Örnek filtreleme verisi:
"flt": {"rules":[
    {"field":"assigned_on","op":"ge","data":null},
    {"field":"assigned_on","op":"lt","data":null}
]} 
Kullanılabilecek operatörler:
eq =
gt >
ge >=
lt <
le <=
in IN (Liste içinde)
bt BETWEEN (İki değer arasında)

Core.account_dids.edit

JSON params içeriği
Parametre Zorunlu? Açıklama
token* Evet** Giriş için kullanılacak TOKEN bilgisi
* TOKEN yerine username ve password bilgileri gönderilebilir.
** Eğer username ve password belirtilmemiş ise TOKEN mutlaka belirtilmelidir.
account_id Evet Hangi hesap için işlem yapılacaksa onun user_id'si.
id Evet Güncellenecek kaydın ID'si.
did Evet Telefon numarası.
is_ext Evet Bu DID'ye client'tan register olunacak ise true, değilse false gönderilmeli
ext_password Hayır Bu DID'ye client'tan register olunacak ise şifre gönderilmeli
ext_subnets Hayır Bu DID'ye client'tan register olunacak ise istemci network bilgisi

Core.account_dids.create

JSON params içeriği
Parametre Zorunlu? Açıklama
token* Evet** Giriş için kullanılacak TOKEN bilgisi
* TOKEN yerine username ve password bilgileri gönderilebilir.
** Eğer username ve password belirtilmemiş ise TOKEN mutlaka belirtilmelidir.
account_id Evet Hangi hesap için işlem yapılacaksa onun user_id'si.
did Evet Telefon numarası.
is_ext Evet Bu DID'ye client'tan register olunacak ise true, değilse false gönderilmeli
ext_password Hayır Bu DID'ye client'tan register olunacak ise şifre gönderilmeli
ext_subnets Hayır Bu DID'ye client'tan register olunacak ise istemci network bilgisi

Core.account_dids.remove

JSON params içeriği
Parametre Zorunlu? Açıklama
token* Evet** Giriş için kullanılacak TOKEN bilgisi
* TOKEN yerine username ve password bilgileri gönderilebilir.
** Eğer username ve password belirtilmemiş ise TOKEN mutlaka belirtilmelidir.
account_id Evet Hangi hesap için işlem yapılacaksa onun user_id'si.
id Evet Silinecek kaydın ID'si. Array olarak birden fazla ID belirtilebilir.
BİZE YAZIN
BİZE YAZIN
 
*
*
*