+90 (216) 222 25 25

FaxMAX API

FaxMAX

Faks Gönderim İptali


Metod
 Fax.cancel_fax_request

Faks gönderilen Fax İstek ID'si ile tüm Faks İsteğindeki gönderimleri iptal eder. Henüz gönderilmemiş olanlarla birlikte, aktif gönderilmekte olanlar da iptal olur.

JSON olarak şu şekilde bilgiler gönderilir:
{
    "jsonrpc":"2.0",
    "id":"fe012e8c-2d2f-47da-b7bb-9d90ee611eb4",
    "method":"Fax.cancel_fax_request",
    "params":{
        "token_":TOKEN,
        "request_id": Faks İstek ID'si
    }
}

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 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.
request_id Evet Faks gönderiminde dönen request_id.
BİZE YAZIN
BİZE YAZIN
 
*
*
*