ملی پیامک مستندات وب‌سرویس پیامک
ملی پیامک مستندات وب‌سرویس پیامک
ملی پیامک مستندات وب‌سرویس پیامک

پاسخ به تیکت

آخرین به‌روزرسانی: 10 آذر 1405

آدرس وب سرویس

متد ResponseTicket2

از این متد جهت پاسخ‌گویی به تیکت موجود استفاده کنید. در صورتی که می‌خواهید اعلان پیامکی نیز ارسال شود، مقدار alertwithsms را برابر با true تنظیم کنید.

پارامتر های ورودی

نام پارامترنوع پارامترتوضیحات
targetusername string اجباری نام کاربری پاسخ‌دهنده.
targetpassword string اجباری ApiKey پاسخ‌دهنده.
ticketid int اجباری شناسه تیکت.
type int اجباری نوع پاسخ؛ سرویس براساس نقش کاربر آن را تعیین می‌کند.
content string اجباری متن پاسخ.
alertwithsms bool اجباری ارسال اعلان پیامکی.
base64stringfile string اختیاری فایل پیوست به‌صورت Base64.
attachedfilename string اختیاری نام فایل پیوست.

مقدار بازگشتی

نام پارامترنوع پارامترتوضیحات
returnvalue int
1: پاسخ به تیکت با موفقیت ثبت شد.
0: پارامترهای ورودی نامعتبر است.
1-: تیکت مورد نظر یافت نشد.
2-: دسترسی مجاز نیست.
3-: تیکت قفل است.
5-: پسوند غیرمجاز است.
6-: PDF دارای JavaScript است.
URL ثبت پاسخ تیکت پشتیبانی:

https://api.payamak-panel.com/post/Tickets.asmx?targetusername=&targetpassword=&ticketid=&type=&content=&alertwithsms=&base64stringfile=&attachedfilename=

ResponseTicket2
$client = new SoapClient('https://api.payamak-panel.com/post/Tickets.asmx?wsdl', [
    'encoding' => 'UTF-8',
    'exceptions' => true,
]);

$params = [
    'targetUsername' => 'VALUE',
    'targetPassword' => 'VALUE',
    'ticketId' => 0,
    'type' => 0,
    'content' => 'VALUE',
    'alertWithSms' => false,
    'base64StringFile' => 'VALUE',
    'attachedFileName' => 'VALUE',
];

$result = $client->__soapCall('ResponseTicket2', [$params]);
var_dump($result);
import soap from "soap";

const [client] = await soap.createClientAsync("https://api.payamak-panel.com/post/Tickets.asmx?wsdl");
const [result] = await client.ResponseTicket2Async({
  targetUsername: "VALUE",
  targetPassword: "VALUE",
  ticketId: 0,
  type: 0,
  content: "VALUE",
  alertWithSms: false,
  base64StringFile: "VALUE",
  attachedFileName: "VALUE",
});

console.log(result);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

var requestBody = """

               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  
    
      VALUE
      VALUE
      0
      0
      VALUE
      false
      VALUE
      VALUE
    
  

""";

var request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.payamak-panel.com/post/Tickets.asmx"))
    .header("Content-Type", "text/xml; charset=utf-8")
    .header("SOAPAction", "\"http://tempuri.org/ResponseTicket2\"")
    .POST(HttpRequest.BodyPublishers.ofString(requestBody))
    .build();

var response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
// Add https://api.payamak-panel.com/post/Tickets.asmx?wsdl as a Connected Service before using the generated proxy.
var client = new TicketsSoapClient(
    TicketsSoapClient.EndpointConfiguration.TicketsSoap
);
var request = new ResponseTicket2Request
{
    targetUsername = "VALUE",
    targetPassword = "VALUE",
    ticketId = 0,
    type = 0,
    content = "VALUE",
    alertWithSms = false,
    base64StringFile = "VALUE",
    attachedFileName = "VALUE",
};

var result = await client.ResponseTicket2Async(request);
Console.WriteLine(result);
from zeep import Client

client = Client("https://api.payamak-panel.com/post/Tickets.asmx?wsdl")
result = client.service.ResponseTicket2(
    targetUsername="VALUE",
    targetPassword="VALUE",
    ticketId=0,
    type=0,
    content="VALUE",
    alertWithSms=False,
    base64StringFile="VALUE",
    attachedFileName="VALUE",
)

print(result)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

var requestBody = """

               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  
    
      VALUE
      VALUE
      0
      0
      VALUE
      false
      VALUE
      VALUE
    
  

""";

var request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.payamak-panel.com/post/Tickets.asmx"))
    .header("Content-Type", "text/xml; charset=utf-8")
    .header("SOAPAction", "\"http://tempuri.org/ResponseTicket2\"")
    .POST(HttpRequest.BodyPublishers.ofString(requestBody))
    .build();

var response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main

import (
    "fmt"
    "io"
    "net/http"
    "strings"
)

func main() {
    requestBody := `
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  
    
      VALUE
      VALUE
      0
      0
      VALUE
      false
      VALUE
      VALUE
    
  
`
    request, err := http.NewRequest(
        http.MethodPost,
        "https://api.payamak-panel.com/post/Tickets.asmx",
        strings.NewReader(requestBody),
    )
    if err != nil {
        panic(err)
    }

    request.Header.Set("Content-Type", "text/xml; charset=utf-8")
    request.Header.Set("SOAPAction", "\"http://tempuri.org/ResponseTicket2\"")

    response, err := http.DefaultClient.Do(request)
    if err != nil {
        panic(err)
    }
    defer response.Body.Close()

    body, err := io.ReadAll(response.Body)
    if err != nil {
        panic(err)
    }
    fmt.Println(string(body))
}
// نمونۀ پاسخ موفق
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ResponseTicket2Response xmlns="http://tempuri.org/">
      <ResponseTicket2Result>1</ResponseTicket2Result>
    </ResponseTicket2Response>
  </soap:Body>
</soap:Envelope>

//نمونۀ خطای SOAP
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ResponseTicket2Response xmlns="http://tempuri.org/">
      <ResponseTicket2Result>-1</ResponseTicket2Result>
    </ResponseTicket2Response>
  </soap:Body>
</soap:Envelope>