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

ادغام گروه‌ها

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

آدرس وب سرویس

متد MergeGroups

از این متد جهت انتقال مخاطبان از گروه مبدأ به گروه مقصد و درصورت نیاز، حذف گروه مبدأ استفاده می‌شود.

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

نام پارامترنوع پارامترتوضیحات
username String اجباری نام کاربری پنل پیامکی شما در سامانه
password String اجباری مقدار API Key شما در سامانه
originGroupId Int اجباری شناسۀ گروه مبدا
destinationGroupId Int اجباری شناسۀ گروه مقصد
deleteOriginGroup bool اجباری درصورت ارسال مقدار true، گروه مبدأ پس از انتقال مخاطبان به گروه مقصد، حذف می‌شود.

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

نام پارامترنوع پارامترتوضیحات
returnValue Int 0: اطلاعات ورود نامعتبر است.
1: عملیات با موفقیت انجام شده است.
2: گروه‌های مشخص‌شده متعلق به حساب کاربری نیستند یا یافت نشده‌اند.

ادغام گروه‌ها از طریق url:

https://api.payamak-panel.com/post/contacts.asmx/MergeGroups?username=&password=&originGroupId=&destinationGroupId=&deleteOriginGroup=

MergeGroups
$client = new SoapClient('https://api.payamak-panel.com/post/contacts.asmx?wsdl', ['encoding' => 'UTF-8', 'exceptions' => true]);
$params = [
    'username' => 'YOUR_USERNAME',
    'password' => 'YOUR_API_KEY',
    'originGroupId' => 10,
    'destinationGroupId' => 20,
    'deleteOriginGroup' => true,
];
$result = $client->__soapCall('MergeGroups', [$params]);
var_dump($result);
import soap from "soap";
const [client] = await soap.createClientAsync("https://api.payamak-panel.com/post/contacts.asmx?wsdl");
const [result] = await client.MergeGroupsAsync({
  username: "YOUR_USERNAME",
  password: "YOUR_API_KEY",
  originGroupId: 10,
  destinationGroupId: 20,
  deleteOriginGroup: true,
});
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/">
  
    
      YOUR_USERNAME
      YOUR_API_KEY
      10
      20
      false
    
  

""";
var request = HttpRequest.newBuilder().uri(URI.create("https://api.payamak-panel.com/post/contacts.asmx"))
    .header("Content-Type", "text/xml; charset=utf-8")
    .header("SOAPAction", "\"http://tempuri.org/MergeGroups\"")
    .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/contacts.asmx?wsdl as a Connected Service before using the generated proxy.
var client = new ContactsSoapClient(ContactsSoapClient.EndpointConfiguration.ContactsSoap);
var request = new MergeGroupsRequest
{
    username = "YOUR_USERNAME",
    password = "YOUR_API_KEY",
    originGroupId = 10,
    destinationGroupId = 20,
    deleteOriginGroup = true,
};
var result = await client.MergeGroupsAsync(request);
Console.WriteLine(result);
from zeep import Client
client = Client("https://api.payamak-panel.com/post/contacts.asmx?wsdl")
result = client.service.MergeGroups(
    username="YOUR_USERNAME",
    password="YOUR_API_KEY",
    originGroupId=10,
    destinationGroupId=20,
    deleteOriginGroup=True,
)
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/">
  
    
      YOUR_USERNAME
      YOUR_API_KEY
      10
      20
      false
    
  

""";
var request = HttpRequest.newBuilder().uri(URI.create("https://api.payamak-panel.com/post/contacts.asmx"))
    .header("Content-Type", "text/xml; charset=utf-8")
    .header("SOAPAction", "\"http://tempuri.org/MergeGroups\"")
    .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/">
  
    
      YOUR_USERNAME
      YOUR_API_KEY
      10
      20
      false
    
  
`
  request, err := http.NewRequest(http.MethodPost, "https://api.payamak-panel.com/post/contacts.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/MergeGroups\"")
  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))
}
//SOAP پاسخ موفق
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <MergeGroupsResponse xmlns="http://tempuri.org/">
      <MergeGroupsResult>1</MergeGroupsResult>
    </MergeGroupsResponse>
  </soap:Body>
</soap:Envelope>

//SOAP خطای 
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <MergeGroupsResponse xmlns="http://tempuri.org/">
      <MergeGroupsResult>2</MergeGroupsResult>
    </MergeGroupsResponse>
  </soap:Body>
</soap:Envelope>