.NET-SDK

dokumentasjon og eksempler

Før du begynner

Last ned siste versjon av SDKet fra GitHub.

Endringer, feil eller tilbakemeldinger kan du legge rett på GitHub. Evt kontakt oss på epost: .

Deklarer Intellipush og legg inn key og secret.

using Intellipush;
using Intellipush.Notifications;
static void Main(string[] args) { IntellipushConfig.APPID = "yyyyyyy"; // Edit to your api appid IntellipushConfig.API_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // Edit to your api secret
} 

Sende en SMS

Send en SMS med gjentakelse eller i fremtiden, til en kontakt eller kontaktlister.

List receivers = new List();
receivers.Add(new PhoneNumber(countrycode, phone));
receivers.Add(new PhoneNumber(countrycode, phone));
sms = new Sms();
sms.Receivers(receivers);
sms.TextMessage = "Hei hei! :)";
sms.When(DateTime.Now.AddMinutes(20));
response = sms.Create();
ja = JArray.Parse(response);
jo = ja.First().Value(); // Get first SMS in batch
Assert.AreEqual((bool)jo.success, true);
int notification_id = jo.data.id;
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => [{"success":true,"data":{"text_message":"Hei hei! :)","html_message":"","date":"2019-04-21","time":"16:33","method":"sms","repeat":"","single_target_countrycode":"0047","single_target":"<PhoneNumber1>","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"X"},"status_message":"Your notification was successfully created."},{"success":true,"data":{"text_message":"Hei hei! :)","html_message":"","date":"2019-04-21","time":"16:33","method":"sms","repeat":"","single_target_countrycode":"0047","single_target":"<PhoneNumber2>","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"Y"},"status_message":"Your notification was successfully created."}] [response] => Array ( [0] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [text_message] => Hei hei! :) [html_message] => [date] => 2019-04-21 [time] => 16:33 [method] => sms [repeat] => [single_target_countrycode] => 0047 [single_target] => <PhoneNumber1> [contact_id] => [contactlist_id] => [contactlist_filter] => [use_sendername] => 1 [two_way_session] => [id] => X ) [status_message] => Your notification was successfully created. ) [1] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [text_message] => Hei hei! :) [html_message] => [date] => 2019-04-21 [time] => 16:33 [method] => sms [repeat] => [single_target_countrycode] => 0047 [single_target] => <PhoneNumber2> [contact_id] => [contactlist_id] => [contactlist_filter] => [use_sendername] => 1 [two_way_session] => [id] => Y ) [status_message] => Your notification was successfully created. ) ) [id] => [errorId] => Array ( ) [success] => Array ( [0] => X [1] => Y ) [message] => Array ( [0] => Your notification was successfully created. [1] => Your notification was successfully created. )
)

Sende flere SMS samtidig

Her kan du sende opptil 999 SMS i en request mot serveren. Kjappere for alle :)

Batch batch = new Batch();
sms = new Sms("Hello World", new PhoneNumber(countrycode, phone));
sms.When(DateTime.Now.AddMinutes(20));
batch.addNotification(sms);
batch.addNotification(new Sms("Hello world!", new PhoneNumber(countrycode, phone)));
response = batch.Create();
ja = JArray.Parse(response);
jo = ja.First().Value(); // Get first SMS in batch
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => [{"success":true,"data":{"text_message":"F\u00f8rste melding. Sendes til 2 telefonnummer","html_message":"","date":"2015-01-29","time":"13:27","method":"sms","repeat":"","single_target_countrycode":"0047","single_target":"12345678","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"W"},"status_message":"Your notification was successfully created."},{"success":true,"data":{"text_message":"F\u00f8rste melding. Sendes til 2 telefonnummer","html_message":"","date":"2015-01-29","time":"13:27","method":"sms","repeat":"","single_target_countrycode":"0047","single_target":"23456789","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"X"},"status_message":"Your notification was successfully created."},{"success":true,"data":{"text_message":"Andre melding. Sendes til 2 nye telefonnummer og skal gjentas hver dag.","html_message":"","date":"2015-01-29","time":"13:27","method":"sms","repeat":"daily","single_target_countrycode":"0047","single_target":"34567890","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"Y"},"status_message":"Your notification was successfully created."},{"success":true,"data":{"text_message":"Andre melding. Sendes til 2 nye telefonnummer og skal gjentas hver dag.","html_message":"","date":"2015-01-29","time":"13:27","method":"sms","repeat":"daily","single_target_countrycode":"0047","single_target":"45678901","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"Z"},"status_message":"Your notification was successfully created."}] [response] => Array ( [0] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [text_message] => Første melding. Sendes til 2 telefonnummer [html_message] => [date] => 2015-01-29 [time] => 13:27 [method] => sms [repeat] => [single_target_countrycode] => 0047 [single_target] => 12345678 [contact_id] => [contactlist_id] => [contactlist_filter] => [use_sendername] => 1 [two_way_session] => [id] => W ) [status_message] => Your notification was successfully created. ) [1] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [text_message] => Første melding. Sendes til 2 telefonnummer [html_message] => [date] => 2015-01-29 [time] => 13:27 [method] => sms [repeat] => [single_target_countrycode] => 0047 [single_target] => 23456789 [contact_id] => [contactlist_id] => [contactlist_filter] => [use_sendername] => 1 [two_way_session] => [id] => X ) [status_message] => Your notification was successfully created. ) [2] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [text_message] => Andre melding. Sendes til 2 nye telefonnummer og skal gjentas hver dag. [html_message] => [date] => 2015-01-29 [time] => 13:27 [method] => sms [repeat] => daily [single_target_countrycode] => 0047 [single_target] => 34567890 [contact_id] => [contactlist_id] => [contactlist_filter] => [use_sendername] => 1 [two_way_session] => [id] => Y ) [status_message] => Your notification was successfully created. ) [3] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [text_message] => Andre melding. Sendes til 2 nye telefonnummer og skal gjentas hver dag. [html_message] => [date] => 2015-01-29 [time] => 13:27 [method] => sms [repeat] => daily [single_target_countrycode] => 0047 [single_target] => 45678901 [contact_id] => [contactlist_id] => [contactlist_filter] => [use_sendername] => 1 [two_way_session] => [id] => Z ) [status_message] => Your notification was successfully created. ) ) [id] => [errorId] => Array ( ) [success] => Array ( [0] => 1 [1] => 1 [2] => 1 [3] => 1 ) [message] => Array ( [0] => Your notification was successfully created. [1] => Your notification was successfully created. [2] => Your notification was successfully created. [3] => Your notification was successfully created. )
)

Alle valg når man sender en SMS

Her er oversikten over alle valgene du kan bruke når du sender SMS.

sms = new Sms();
sms.ContactId = contact_id; // Kontakt ID
sms.ContactlistId = contactlist_id; // Kontaktliste ID
sms.TextMessage = "Hello world.";
sms.ContactlistFilter = filter; // Dette må være et kontaktfilter objekt se nedenfor.
sms.Repeat = "daily"; // Daily, weekly, monthly eller blank.
sms.When = "now" // Må være i formatet 2013-04-20 22:15:00, eller "now"

Oppdater SMS

Du kan oppdatere alle eller kun noen av verdiene på en SMS

sms = new Sms(notification_id);
sms.TextMessage = "Hello! This is an updated notification!";
sms.When(DateTime.Now.AddMinutes(50));
sms.Repeat = "";
response = sms.Update();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"text_message":"Hello! This is an updated notification!","html_message":"","date":"2019-04-21","time":"17:03","method":"sms","repeat":"","single_target_countrycode":"0047","single_target":"12345678","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":X},"status_message":"Your notification was successfully updated."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [text_message] => Hello! This is an updated notification! [html_message] => [date] => 2019-04-21 [time] => 17:03 [method] => sms [repeat] => [single_target_countrycode] => 0047 [single_target] => 12345678 [contact_id] => [contactlist_id] => [contactlist_filter] => [use_sendername] => 1 [two_way_session] => [id] => X ) [status_message] => Your notification was successfully updated. ) [id] => X [errorId] => [success] => 1 [message] => Your notification was successfully updated.
)

Slett SMS

Du kan slette SMSer som enda ikke er sendt.

sms = new Sms(notification_id);
response = sms.Delete();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"id":"X","when":"2019-04-24 16:13","text_message":"Yay! Jeg klarte å oppdatere SMS meldinga.","method":"sms","single_target_countrycode":"0047","single_target":"12345678","use_sendername":"1"},"status_message":"Your notification was successfully deleted."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [id] => X [when] => 2019-04-24 16:13:00 [text_message] => Yay! Jeg klarte å oppdatere SMS meldinga. [method] => sms [single_target_countrycode] => 0047 [single_target] => 12345678 [use_sendername] => 1 ) [status_message] => Your notification was successfully deleted. ) [id] => X [errorId] => [success] => 1 [message] => Your notification was successfully deleted.
)

Hent usendte meldinger

Henter ut meldinger som enda ikke er sendt.

sms = new Sms();
sms.Items = 20;
sms.Page = 1;
response = sms.GetUnsendt();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"X":{"id":"X","uid":"W","timetosend":"2015-01-25 19:56:02","internal_id":"","external_id":"","deleted":"0","sendt":"0","text_message":"Hei hei! :)","method":"sms","single_target_countrycode":"0047","single_target":"12345678","use_sendername":"1"},"Y":{"id":"Y","uid":"W","timetosend":"2015-01-25 19:56:16","internal_id":"","external_id":"","deleted":"0","sendt":"0","text_message":"Hei hei! :)","method":"sms","single_target_countrycode":"0047","single_target":"12345678","use_sendername":"1"} },"status_message":"Successfully fetched notifications.","pages":292} [response] => stdClass Object ( [success] => 1 [data] => Array ( [0] => stdClass Object ( [id] => X [uid] => W [timetosend] => 2050-01-01 20:00:00 [internal_id] => [external_id] => [deleted] => 0 [sendt] => 0 [text_message] => Hei hei! :) [method] => sms [single_target_countrycode] => 0047 [single_target] => 12345678 [use_sendername] => 1 ) [1] => stdClass Object ( [id] => Y [uid] => W [timetosend] => 2050-01-01 20:00:00 [internal_id] => [external_id] => [deleted] => 0 [sendt] => 0 [text_message] => Hei hei! :) [method] => sms [single_target_countrycode] => 0047 [single_target] => 12345678 [use_sendername] => 1 ) ) [status_message] => Successfully fetched notifications. [pages] => 1 ) [id] => [errorId] => [success] => 1 [message] => Successfully fetched notifications.
)

Hent sendte meldinger

Henter ut meldinger som er sendt.

sms = new Sms();
sms.Items = 10;
sms.Page = 1;
response = sms.GetSendt();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"X":{"id":"X","uid":"W","timetosend":"2015-01-25 19:56:02","internal_id":"","external_id":"","deleted":"0","sendt":"0","text_message":"Hei hei! :)","method":"sms","single_target_countrycode":"0047","single_target":"12345678","use_sendername":"1"},"Y":{"id":"Y","uid":"W","timetosend":"2015-01-25 19:56:16","internal_id":"","external_id":"","deleted":"0","sendt":"0","text_message":"Hei hei! :)","method":"sms","single_target_countrycode":"0047","single_target":"12345678","use_sendername":"1"} },"status_message":"Successfully fetched notifications.","pages":292} [response] => stdClass Object ( [success] => 1 [data] => Array ( [0] => stdClass Object ( [id] => X [uid] => W [timetosend] => 2015-01-01 20:00:00 [internal_id] => [external_id] => [deleted] => 0 [sendt] => 0 [text_message] => Hei hei! :) [method] => sms [single_target_countrycode] => 0047 [single_target] => 12345678 [use_sendername] => 1 ) [1] => stdClass Object ( [id] => Y [uid] => W [timetosend] => 2015-01-01 20:00:00 [internal_id] => [external_id] => [deleted] => 0 [sendt] => 0 [text_message] => Hei hei! :) [method] => sms [single_target_countrycode] => 0047 [single_target] => 12345678 [use_sendername] => 1 ) ) [status_message] => Successfully fetched notifications. [pages] => 1 ) [id] => [errorId] => [success] => 1 [message] => Successfully fetched notifications.
)

Hent motatte meldinger

Henter ut meldinger som er motatt på kodeord.

-MISSING IN .NET SDK FOR NOW- 
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":[{"id":"X","uid":"Y","reference":"N","request_type":"sms","request_sender":"Z","request_target":"T","replypath":"0","trigger_external_path":"","keyword":"intellipush","second_keyword":"","message":"a","raw":"a:14:{s:1:\"q\";s:20:\"\/incoming\/vianettsms\";s:5:\"refno\";s:8:\"N\";s:3:\"now\";s:14:\"20150522030900\";s:11:\"requesttype\";s:2:\"mo\";s:10:\"sourceaddr\";s:10:\"Z\";s:15:\"destinationaddr\";s:4:\"T\";s:11:\"replypathid\";s:1:\"0\";s:6:\"prefix\";s:11:\"intellipush\";s:7:\"message\";s:1:\"a\";s:10:\"retrycount\";s:1:\"0\";s:8:\"operator\";s:1:\"1\";s:11:\"referenceid\";s:39:\"CPAd6569e1f-b119-4c86-88fb-816f5dd10ac8\";s:8:\"username\";s:0:\"\";s:8:\"password\";s:0:\"\";}","time":"2015-05-22 03:09:00"}],"status_message":"Successfully fetched received notifications.","pages":190} [response] => stdClass Object ( [success] => 1 [data] => Array ( [0] => stdClass Object ( [id] => X [uid] => Y [reference] => N [request_type] => sms [request_sender] => Z [request_target] => T [replypath] => 0 [trigger_external_path] => [keyword] => intellipush [second_keyword] => [message] => a [raw] => a:14:{s:1:"q";s:20:"/incoming/vianettsms";s:5:"refno";s:8:"N";s:3:"now";s:14:"20150522030900";s:11:"requesttype";s:2:"mo";s:10:"sourceaddr";s:10:"Z";s:15:"destinationaddr";s:4:"T";s:11:"replypathid";s:1:"0";s:6:"prefix";s:11:"intellipush";s:7:"message";s:1:"a";s:10:"retrycount";s:1:"0";s:8:"operator";s:1:"1";s:11:"referenceid";s:39:"CPAd6569e1f-b119-4c86-88fb-816f5dd10ac8";s:8:"username";s:0:"";s:8:"password";s:0:"";} [time] => 2015-05-22 03:09:00 ) ) [status_message] => Successfully fetched received notifications. [pages] => 1 ) [id] => Array ( [0] => X ) [errorId] => [success] => 1 [message] => Successfully fetched received notifications.
)

Hent meldingsstatus

Sjekk status på en melding.

response = new Status(notification_id).GetStatus();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"X":{"id":"X","sendt":"0","failed":0,"tries":0,"deleted":"0","timesendt":""} },"status_message":"Successfully got status on your notification."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [X] => stdClass Object ( [id] => X [sendt] => 0 [failed] => 0 [tries] => 0 [deleted] => 0 [timesendt] => ) ) [status_message] => Successfully got status on your notification. ) [id] => [errorId] => [success] => 1 [message] => Successfully got status on your notification.
)

Kontaktfilter

Ved flere anledninger kan du filtrere kontaktlister med følgende filter.

filter = new Filter();
filter.Sex = "female"; // Kan være "male" eller "female"
filter.Age = "20-30,41,42,43,50-60"; //Kommaseparert string;
filter.Country = "norway, sweeden, denmark"; //Kommaseparert string
filter.Company = "Intellipush,Your company"; //Kommaseparert string
filter.Param1 = "Value1, Value2"; //Kommaseparert string
filter.Param2 = "Value1, Value2"; //Kommaseparert string
filter.Param3 = "Value1, Value2"; //Kommaseparert string

Opprette en kontakt

Du kan opprette kontakter som vi senere kan legge i kontaktlister.

contact = new Contact("Girly Girl");
contact.CountryCode = countrycode;
contact.PhoneNumber = phone;
contact.Company = "Intellipush";
contact.Sex = "female";
response = contact.Create();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
int contact_id = jo.data.id;
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"name":"Girly Girl","company":"Intellipush","dob":"","sex":"female","zipcode":"","country":"","countrycode":"0047","phonenumber":"12345678","email":"","facebook":"","twitter":"","param1":"","param2":"","param3":"","id":"X"},"status_message":"The contact was successfully created."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [name] => Girly Girl [company] => Intellipush [dob] => [sex] => female [zipcode] => [country] => [countrycode] => 0047 [phonenumber] => 12345678 [email] => [facebook] => [twitter] => [param1] => [param2] => [param3] => [id] => X ) [status_message] => The contact was successfully created. ) [id] => X [errorId] => [success] => 1 [message] => The contact was successfully created.
)

Hent en kontakt

Hent ut hele kontakter baret på kontakt id.

contact = new Contact(contact_id);
response = contact.GetContact();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"name":"Girly Girl","company":"Intellipush","dob":"","sex":"female","zipcode":"","country":"","countrycode":"0047","phonenumber":"12345678","email":"","facebook":"","twitter":"","param1":"","param2":"","param3":"","id":"X"},"status_message":"The contact was successfully created."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [name] => Girly Girl [company] => Intellipush [dob] => [sex] => female [zipcode] => [country] => [countrycode] => 0047 [phonenumber] => 12345678 [email] => [facebook] => [twitter] => [param1] => [param2] => [param3] => [id] => X ) [status_message] => The contact was successfully created. ) [id] => X [errorId] => [success] => 1 [message] => The contact was successfully created.
)

Oppdater en kontakt

Oppdater kontakten med ny informasjon.

contact = new Contact(contact_id2);
contact.Name = "Updated Manly Man";
response = contact.Update();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"name":"Updated Girly Girl","company":"Intellipush","dob":"","sex":"female","zipcode":"","country":"","countrycode":"0047","phonenumber":"12345678","email":"","facebook":"","twitter":"","param1":"","param2":"","param3":"","id":"X"},"status_message":"The contact was successfully updated."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [name] => Updated Girly Girl [company] => Intellipush [dob] => [sex] => female [zipcode] => [country] => [countrycode] => 0047 [phonenumber] => 12345678 [email] => [facebook] => [twitter] => [param1] => [param2] => [param3] => [id] => X ) [status_message] => The contact was successfully updated. ) [id] => X [errorId] => [success] => 1 [message] => The contact was successfully updated.
)

Slett en kontakt

Denne er vel selvforklarende...

contact = new Contact(contact_id);
response = contact.Delete();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"id":"X"},"status_message":"The contact was successfully deleted."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [id] => X ) [status_message] => The contact was successfully deleted. ) [id] => X [errorId] => [success] => 1 [message] => The contact was successfully deleted.
) 

Opprett en kontaktliste

Lag en ny kontaktliste.

contactlist = new ContactList("newList");
response = contactlist.Create();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
int contactlist_id = jo.data.id;
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"contactlist_name":"Alle Kunder","id":"X"},"status_message":"Your contactlist was successfully created."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [contactlist_name] => Alle Kunder [id] => X ) [status_message] => Your contactlist was successfully created. ) [id] => X [errorId] => [success] => 1 [message] => Your contactlist was successfully created.
)

Hent en kontaktliste

Denne returnerer en kontaktliste, samt id på alle kontaktr i listen.

contactlist = new ContactList(contactlist_id);
response = contactlist.GetContactList();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"id":"X","list_name":"Alle Kunder","contacts":""},"status_message":""} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [id] => X [list_name] => Alle Kunder [contacts] => ) [status_message] => ) [id] => X [errorId] => [success] => 1 [message] =>
)

Oppdater kontaktliste

Gi en kontaktliste et nytt navn.

contactlist = new ContactList();
contactlist.Id = contactlist_id;
contactlist.Name = "Updated Contactlist";
response = contactlist.Update();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"contactlist_name":"Oppdatert Alle Kunder","id":"X"},"status_message":"Your contactlist was successfully updated."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [contactlist_name] => Oppdatert Alle Kunder [id] => X ) [status_message] => Your contactlist was successfully updated. ) [id] => X [errorId] => [success] => 1 [message] => Your contactlist was successfully updated.
)

Slett en kontaktliste

Sletter en kontaktliste, men sletter ingen av kontaktene i kontaktlisten.

contactlist = new ContactList(contactlist_id);
response = contactlist.Delete();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"id":"X"},"status_message":"Contactlist successfully deleted."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [id] => X ) [status_message] => Contactlist successfully deleted. ) [id] => X [errorId] => [success] => 1 [message] => Contactlist successfully deleted.
)

Legg kontakt i kontaktliste

Legger en kontakt til i kontaktliste klar for filtrering og søk.

 contactlist = new ContactList(contactlist_id); response = contactlist.AddContact(contact_id); jo = JObject.Parse(response); Assert.AreEqual((bool)jo.success, true); response = contactlist.AddContact(contact_id2); jo = JObject.Parse(response); Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"contactlist_id":"X","contact_id":"Y"},"status_message":"The contact was added to the contactlist."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [contactlist_id] => X [contact_id] => Y ) [status_message] => The contact was added to the contactlist. ) [id] => [errorId] => [success] => 1 [message] => The contact was added to the contactlist.
)

Fjerne kontakt fra kontaktliste

Fjerne kontakt fra en kontaktliste.

contactlist = new ContactList(contactlist_id);
response = contactlist.RemoveContact(contact_id);
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"contactlist_id":"X","contact_id":"Y"},"status_message":"The contact was removed from the contactlist."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [contactlist_id] => X [contact_id] => Y ) [status_message] => The contact was removed from the contactlist. ) [id] => [errorId] => [success] => 1 [message] => The contact was removed from the contactlist.
)

Hent antall kontakter i kontaktlisten

Henter ut antall kontakter i en kontaktliste basert på insendte filtreringskriterier.

filter = new Filter();
filter.Sex = "female";
contactlist = new ContactList(78);
contactlist.Filter = filter;
response = contactlist.GetContactsAmountInList();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"amount":"X"},"status_message":"Successfully got the number of contacts matching your filter."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [amount] => X ) [status_message] => Successfully got the number of contacts matching your filter. ) [id] => [errorId] => [success] => 1 [message] => Successfully got the number of contacts matching your filter.
)

Hent kontakter i kontaktlisten.

Hent og filtrer kontakter som ligger i kontaktlisten.

filter = new Filter();
filter.Sex = "female";
contactlist = new ContactList(contactlist_id);
contactlist.Items = 20;
contactlist.Page = 1;
contactlist.Query = "";
contactlist.Filter = filter;
response = contactlist.GetContactsInList();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":"","status_message":"No contacts matching your search.","pages":0} [response] => stdClass Object ( [success] => 1 [data] => [status_message] => No contacts matching your search. [pages] => 0 ) [id] => [errorId] => [success] => 1 [message] => No contacts matching your search.
)

Kontakter som ikke er i kontaktlisten.

Søk etter kontakter som ikke allerede er lagt til i en kontaktliste.

$contactlist = new Intellipush\Contactlist();
$contactlist->id ( $contactlist_id )->items(20)->page(1)->query("st")->notInContactlist(true);
$response = $intellipush->read($contactlist);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":"","status_message":"No contacts matching your search.","pages":0} [response] => stdClass Object ( [success] => 1 [data] => [status_message] => No contacts matching your search. [pages] => 0 ) [id] => [errorId] => [success] => 1 [message] => No contacts matching your search.
)

Info om brukerkonto

Hent ut informasjon om aktiv brukerkonto.

User user = new User();
response = user.GetAccount();
jo = JObject.Parse(response);
Assert.AreEqual((bool)jo.success, true);
Intellipush\Response Object
( [httpStatusCode] => 200 [rawResponse] => {"success":true,"data":{"uid":"X","smscost":0.69,"dst":"1","timezonename":"Europe\/Berlin","register_time":"2015-01-01 12:00:00","smssendername":"Intellipush","senderemail":"navn.navnesen@epost.no","senderemailname":"","smsprice":"","validatedphone":"1","name":"Kontonavn"},"status_message":"Successfully got the user details."} [response] => stdClass Object ( [success] => 1 [data] => stdClass Object ( [uid] => X [smscost] => 0.69 [dst] => 1 [timezonename] => Europe/Berlin [register_time] => 2015-01-01 12:00:00 [smssendername] => Intellipush [senderemail] => navn.navnesen@epost.no [senderemailname] => [smsprice] => [validatedphone] => 1 [name] => Kontonavn ) [status_message] => Successfully got the user details. ) [id] => [errorId] => [success] => 1 [message] => Successfully got the user details.
)

Lurer du på noe?

Ta gjerne kontakt med oss, vi svarer på mail i løpet av 8 arbeidstimer ;)

Epost:
Telefon: 400 41 952

x
x
x
x