Documentatie

Berichten

Bericht versturen

POST /api/sms
 

Benodigde paramaters om een bericht te versturen

 
Attribute Type Omschrijving
from string Verzender van het bericht
to array,string Array of String (gescheiden voor komma) van ontvangers (gsm nummers)
content string Het SMS bericht (max 500 tekens)

Individueel bericht voorbeeld:

$sms = new SMSApi_Sms("API_KEY", "API_SECRET");
$data = $sms->send([
    "from" 	=> "SMS_SENDER",
    "to" 	=> ["NUMBER"],
    "content" 	=> "Have a nice day",
]);
curl 'http://smsapi.be/nl/api/sms' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "content=Have a nice day." \ 
    -d from=SMSAPI_NUMBER
 

Groepsbericht

POST /api/sms/group

Benodigde paramaters om een Groepsbericht te versturen

 
Attribute Type Omschrijving
from string Verzender van het bericht
group_id array,string Array of String (gescheiden voor komma) van group id's
content string Het SMS bericht (max 500 tekens)

Groepsbericht voorbeeld:

$sms = new SMSApi_Sms("API_KEY", "API_SECRET");
$data = $sms->group([
	"group_id" 	=> [1,2,3],
    "from" 	=> "SMS_SENDER",    
    "content" 	=> "Have a nice day",
]);
curl 'http://smsapi.be/sms/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER

Opvragen

GET /api/sms/message
 

Optionele parameters bij het opvragen van berichten 

Attribute Type Omschrijving
limit int Max aantal berichten (standaard 20)
offset int Berichten offset
$sms = new SMSApi_Sms("API_KEY", "API_SECRET");
$data = $sms->messages(["limit" => 5 , "offset" => 5]);
curl 'http://smsapi.be/nl/api/sms/message' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d limit=5 \
    -d offset=5
 

Callback Voorbeeld:

{
	success: 1,
	data: [
		{
			messageID: 1,
			from: "SMS Sender",
			content: "Have a nice day",
			total_count: 1,
			send_count: 1,
			time_created: "2017-04-26 11:16:51",
			scheduled_time: "2017-05-26 08:20:00"
		},
		{
			messageID: 2,
			from: "SMS Sender",
			content: "Test message 2",
			total_count: 2,
			send_count: 2,
			time_created: "2017-04-26 11:18:55"
		}
	],
	offset: 5,
	limit: 5,
	total_count: 374
}
 
GET /api/sms/message/:id
 

Bericht detail opvragen

Attribute Type Omschrijving
messageID int Uniek ID van het bericht
$sms = new SMSApi_Sms("API_KEY", "API_SECRET");
$data = $sms->message( "messageID" );
curl 'http://smsapi.be/nl/api/sms/message/:id' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET 
 

Callback Voorbeeld:

{
	success: 1,
	data: {
		messageID: 43,
		from: "SMS Sender",
		content: "Have a nice day",
		total_count: 3,
		send_count: 0,
		time_created: "2017-09-08 11:44:48",
		sms_items: [
			{
				smsID: "5618",
				contactID: "9128",
				from: "SMS Sender",
				to: "32486******",
				send_status: "1",
				time_in: "2017-07-17 15:23:49",
				time_send: "2017-07-17 15:23:49",
				content: "Have a nice day",
				msg_length: "21",
				msg_count: 1,
				price: "0.08"
			}
		]
	}
}
 
GET /api/sms/:id
 

SMS detail opvragen

Attribute Type Omschrijving
smsID int Uniek ID van de sms
$sms = new SMSApi_Sms("API_KEY", "API_SECRET");
$data = $sms->get( "smsID" );
curl 'http://smsapi.be/nl/api/sms/:id' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET
 

Callback Voorbeeld:


{
	success: 1,
	data: {
		
		smsID: "5618",
		contactID: "9128",
		from: "SMS Sender",
		to: "32486******",
		send_status: "1",
		time_in: "2017-07-17 15:23:49",
		time_send: "2017-07-17 15:23:49",
		content: "Have a nice day",
		msg_length: "21",
		msg_count: 1,
		price: "0.08"
			
	}
}
 

Contacten

Aanmaken

POST /api/contact

Benodigde paramaters om een contact aan te maken

Attribute Type Omschrijving
name string Contact naam
number int Gsm nummer

Contact aanmaken voorbeeld

$contact = new SMSApi_Contact("API_KEY", "API_SECRET");
$data = $contact->create([
    "name" 	=> "Contact Name",
    "number" 	=> "NUMBER",
]);
curl 'http://smsapi.be/sms/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER

Aanpassen

PUT /api/contact/:id

Optionele paramaters om een contact aan te passen

Attribute Type Omschrijving
name string Contact naam
number int Gsm nummer

Contact aanpassen voorbeeld

$contact = new SMSApi_Contact("API_KEY", "API_SECRET");
$data = $contact->update("contactID",[
    "name" 	=> "Contact Name",
    "number" 	=> "NUMBER",
]);
curl 'http://smsapi.be/sms/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER

Opvragen

GET /api/contact

Optionele parameters bij het opvragen van contacten

Attribute Type Omschrijving
limit int Max aantal contacten (standaard 20)
offset int Contacten offset
$contact = new SMSApi_Contact("API_KEY", "API_SECRET");
$data = $contact->get(["limit" => 5 , "offset" => 5]);
curl 'http://smsapi.be//contact/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER
 

Callback Voorbeeld:

{
	success: 1,
	data: [
		{
			contactID: 1,
			name: null,
			number: "+32488888888",
			var1: null,
			var2: null,
			var3: null,
			var4: null,
			var5: null,
			var6: null,
			groups: [
				{
					groupID: "1",
					name: "SMS Api Group"
				},
				{
					groupID: "2",
					name: "SMS Api Group 2"
				}
			]
		},
		{
			contactID: 2,
			name: null,
			number: "+32499999999",
			var1: null,
			var2: null,
			var3: null,
			var4: null,
			var5: null,
			var6: null,
			groups: [
				{
					groupID: "1",
					name: "SMS Api Group"
				}
			]
		},
	],
	offset: 0,
	limit: 20,
	total_count: 5
}
 
GET /api/contact/:id

Contact detail opvragen

Attribute Type Omschrijving
contactID int Uniek ID van contact
$contact = new SMSApi_Contact("API_KEY", "API_SECRET");
$data = $contact->get( "contactID" );
curl 'http://smsapi.be//contact/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER
 

Callback Voorbeeld:

{
	success: 1,
	data: {
		contactID: 1,
		name: null,
		number: "32488888888",
		var1: null,
		var2: null,
		var3: null,
		var4: null,
		var5: null,
		var6: null,
		groups: [
			{
				groupID: "1",
				name: "SMS Api Group"
			},
			{
				groupID: "2",
				name: "SMS Api Group 2"
			}
		]
	},
}
  

Verwijderen

DELETE /api/contact/:id

Contact verwijderen voorbeeld

$contact = new SMSApi_Contact("API_KEY", "API_SECRET");
$data = $contact->delete("contactID");
curl 'http://smsapi.be/sms/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER

Groepen

Aanmaken

POST /api/group

Benodigde paramaters om een groep aan te maken

Attribute Type Omschrijving
name string Groep naam

Contact aanmaken voorbeeld

$group = new SMSApi_Group("API_KEY", "API_SECRET");
$data = $group->create([
    "name" 	=> "Group Name",
]);
curl 'http://smsapi.be/sms/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER

Aanpassen

PUT /api/group/:id

Optionele paramaters om een groep aan te passen

Attribute Type Omschrijving
name string Contact naam

Groep aanpassen voorbeeld

$group = new SMSApi_Group("API_KEY", "API_SECRET");
$data = $group->update("groupID",[
    "name" 	=> "Group Name",
]);
curl 'http://smsapi.be/sms/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER

Opvragen

GET /api/group

Optionele parameters bij het opvragen van groepen

Attribute Type Omschrijving
limit int Max aantal groepen (standaard 20)
offset int Groepen offset
$group = new SMSApi_Group("API_KEY", "API_SECRET");
$data = $group->get(["limit" => 5 , "offset" => 5]);
curl 'http://smsapi.be//contact/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER
 

Callback Voorbeeld:

{
	success: 1,
	data: [
		{
			groupID: 1,
			name: "Groep 1",
			contact_count: 3
		},
		{
			groupID: 2,
			name: "Groep 2",
			contact_count: 1
		},
		{
			groupID: 3,
			name: "Groep 3"
		}
	],
	offset: 0,
	limit: 20,
	total_count: 3
}
 
GET /api/group/:id

Groep detail opvragen

Attribute Type Omschrijving
groupID int Uniek ID van de groep
$group = new SMSApi_Group("API_KEY", "API_SECRET");
$data = $group->get( "groupID" );
curl 'http://smsapi.be//contact/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER
 

Callback Voorbeeld:

{
	success: 1,
	data: {
		groupID: 1,
		name: "Groep 1",
		contact_count: 3
	}
}
  

Verwijderen

DELETE /api/group/:id

Groep verwijderen voorbeeld

$group = new SMSApi_Group("API_KEY", "API_SECRET");
$data = $group->delete("groupID");
curl 'http://smsapi.be/sms/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER

Contacten Toevoegen

POST /api/group/:id/contact

Benodigde paramaters om een contact toe te voegen aan een groep

Attribute Type Omschrijving
groupID int Uniek id van de groep
number array,string Array of String (gescheiden voor komma) van contacten (gsm nummers)
contact_id array,string Array of String (gescheiden voor komma) van contacten (contactID)

Nummer(s) of contactID(s) verplicht.

Contact aanmaken voorbeeld

$group = new SMSApi_Group("API_KEY", "API_SECRET");
$data = $group->addContact("groupID",[
    "number" 	=> ["NUMBER"],
]);
curl 'http://smsapi.be/sms/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER

Contacten opvragen

GET /api/group/:id/contact

Optionele parameters bij het opvragen van contacten uit een groep

Attribute Type Omschrijving
limit int Max aantal contacten (standaard 20)
offset int Contacten offset

Contacten van een groep opvragen voorbeeld.

$group = new SMSApi_Group("API_KEY", "API_SECRET");
$data = $group->getContacts("groupID" , ["limit" => 5 , "offset" => 0]);
curl 'http://smsapi.be/sms/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER


Callback Voorbeeld:

{
	success: 1,
	data: [
		{
			contactID: 1,
			name: null,
			number: "+32488888888",
			var1: null,
			var2: null,
			var3: null,
			var4: null,
			var5: null,
			var6: null
		},
		{
			contactID: 2,
			name: null,
			number: "+32499999999",
			var1: null,
			var2: null,
			var3: null,
			var4: null,
			var5: null,
			var6: null
		},
	],
	offset: 0,
	limit: 5,
	total_count: 5
}

Contacten Verwijderen

DELETE /api/group/:id/contact/:id

Contact verwijderen uit groep voorbeeld

$group = new SMSApi_Group("API_KEY", "API_SECRET");
$data = $group->deleteContact("groupID","contactID");
curl 'http://smsapi.be/sms/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER

Saldo

Opvragen

GET /api/saldo

Saldo opvragen voorbeeld

$saldo = new SMSApi_Saldo("API_KEY", "API_SECRET");
$data = $saldo->get();
curl 'http://smsapi.be//contact/json' \ 
    -d  api_key=API_KEY \ 
    -d api_secret=API_SECRET \ 
    -d to=YOUR_NUMBER \ 
    --data-urlencode "text=Have a nice day." \ 
    -d from=SMSAPI_NUMBER
 

Callback Voorbeeld:

{
	success: 1,
	data: {
		saldo_excl: 100,
		saldo_incl: 121
	}
}
 

Maak een test account

Test gratis ons systeem uit zonder enige verplichting!