Doc Partner
SMS Partner
Doc Partner - EN
Doc Partner - EN
  • Welcome
  • API
    • SMS Partner
      • Credits
      • Send SMS
        • Single Send
        • Bulk Send
        • Send by Long Number
        • Survey Send
        • Cancel Scheduled SMS
        • Special Characters
      • Status & Statistics
        • Single Status
        • Bulk Status
        • Status by Message
        • Status by Tag
        • Sending Statistics
      • Contact Management
        • Add Group
        • Add Contact
        • Delete Group
        • Add Bulk Contacts
        • Edit Contact
        • Delete Contact
        • Get Group List
        • Get Contact List
        • Get Contact Details
      • Replies / Opt-outs Management
        • Stop List
        • Add Number to SMS Stop List
        • Remove Number from SMS Stop List
        • Replies Management
      • Sub-accounts
        • Activation
        • Create Sub-account
        • Delete Sub-account
        • Sub-account List
        • Manage Sub-account Credits
      • Manage Call Forwarding
      • Number Verification
        • Send a Verification
        • Format Verification
      • Contact Rental
        • Categories
        • Targeting & Calculation
        • Rental Status
        • Download File
      • RCS
    • Error Codes
Powered by GitBook

© 2025 NDA Media

On this page
  1. API
  2. SMS Partner
  3. Contact Rental

Rental Status

This request allows you to retrieve the status of a contact rental.

URL

GET https://api.smspartner.fr/v1/location/status

Parameters

Name
Value

apiKey

token

Rental identifier.

Requests

<?php
 
        // Prepare data for GET request
        $data = 'apiKey=YOUR_API_KEY&token=xxx';
 
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL,'https://api.smspartner.fr/v1/location/status?'.$data);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_TIMEOUT, 10);
 
 
        $result = curl_exec($curl);
        curl_close($curl);
 
        // Process your response here
        echo $result;
?> 
Imports System.IO
Imports System.Net
 
Module Module1
 
  Sub Main()
 
    Dim base_url As String = "http://api.smspartner.fr/v1/"
    Dim apiKey As String = "VOTRE_APIKEY"
    Dim token As String = XXX
 
    #check credits
    Dim url As String
    url = base_url & "location/status" & "?apiKey=" & apiKey & "&token=" & token
 
    Dim credits As String
    credits = apiRequest("GET", url, Nothing)
 
  End Sub
 
  Function apiRequest(method As String, url As String, parameters As String) As String
 
    Dim request As HttpWebRequest
    request = WebRequest.Create(url)
    request.Method = method
    request.Timeout = 10000   # timeout in ms
    request.ContentType = "application/json; charset=utf-8"
    request.ContentLength = 0
 
    #set POST data
    If Not String.IsNullOrEmpty(parameters) Then
      request.ContentLength = parameters.Length
      Using reqStream As StreamWriter = New StreamWriter(request.GetRequestStream())
        reqStream.Write(parameters)
      End Using
    End If
 
    #get response
    Dim returnValue As String = Nothing
    Using response As HttpWebResponse = request.GetResponse()
      If response.StatusCode = HttpStatusCode.OK Then
        Using resStream = response.GetResponseStream()
          If resStream IsNot Nothing Then
            Using reader As New StreamReader(resStream)
              returnValue = reader.ReadToEnd()
            End Using
          End If
        End Using
      End If
    End Using
    apiRequest = returnValue
 
  End Function
 
End Module
# std
import logging
import json
from collections import OrderedDict
 
# 3p
import requests
 
API_KEY = "MY API KEY"
URL = "https://api.smspartner.fr/v1"
 
class SMSPartner():
    def get_delivery(self,token):
		url = URL + "/location/status?apiKey=" + API_KEY +  "&token=" + token
		r = requests.get(url)
		r_json = r.json()
		if r_json.get("success") == True:
			print(r_json)
			status = True
		else:
			print(r_json)
			status = False
		return status
curl -H  "Content-Type: application/json" -X GET  https://api.smspartner.fr/v1/location/status?apiKey=xxx&token=xxx

Response

{
    "success": true,
    "token": "identifiant de la location",
    "status": "File downloaded by user from api",
    "location": {
        "sexe": "femme",
        "minAge": 31,
        "maxAge": 49,
        "zipcode": "60200",
        "interest": "12",
        "category": 103,
        "details_localisation": [
            {
                "Type": "cp",
                "Location": "60200",
                "VolumeDesired": "10",
                "Volume": "266"
            }
        ],
        "cost": {
            "quantity": 10,
            "total": "0.900",
            "cost_unity": "0.090"
        }
    },
    "file": {
        "phoneNumbers": "10"
    }
}
<?xml version='1.0' encoding='UTF-8'?>
<result>
    <entry>true</entry>
    <entry>
        <![CDATA[b22b841a21624f4f452ba7fa8c822c0ed7cecfdb]]>
    </entry>
    <entry>
        <![CDATA[File downloaded by user from api]]>
    </entry>
    <entry>
        <entry>
            <![CDATA[femme]]>
        </entry>
        <entry>31</entry>
        <entry>49</entry>
        <entry>
            <![CDATA[60200]]>
        </entry>
        <entry>
            <![CDATA[12]]>
        </entry>
        <entry>103</entry>
        <entry>
            <entry>
                <entry>
                    <![CDATA[cp]]>
                </entry>
                <entry>
                    <![CDATA[60200]]>
                </entry>
                <entry>
                    <![CDATA[10]]>
                </entry>
                <entry>
                    <![CDATA[266]]>
                </entry>
            </entry>
        </entry>
        <entry>
            <entry>10</entry>
            <entry>
                <![CDATA[0.900]]>
            </entry>
            <entry>
                <![CDATA[0.090]]>
            </entry>
        </entry>
    </entry>
    <entry>
        <entry>
            <![CDATA[10]]>
        </entry>
    </entry>
</result>

Errors

{
    "success": false,
    "code": 10,
    "message": "Clé API incorrecte"
}
<?xml version="1.0" encoding="UTF-8"?>
<result>
    <entry>false</entry>
    <entry>10</entry>
    <entry>
        <![CDATA[Clé API incorrecte]]>
    </entry>
</result>

Rental status codes

Response Code
Message

0

The rental request has been made

1

File is being generated

2

File is ready. You can download it.

3

The rental request failed

5

File has already been downloaded

Error codes

Response Code
Message

1

API key is required

10

Invalid API key

31

Rental token is required

32

Rental not found

200

Everything went well!

PreviousTargeting & CalculationNextDownload File

Last updated 1 month ago

Your API key