Kontakty- organizacje
1. Pobranie listy kontaktów- organizacji zapisanych w CRM
Metoda pozwala na pobranie kontaktów (organizacji) zapisanych w bazie CRM.
Metoda: GET
Adres URL: www.{twoja_nazwa}.ccrm.pl/publicApi/organisations
Metoda stosuje stronicowanie powyżej 1000 rekordów. API zwróci zawsze maksymalnie 1000 rekordów, a o resztę należy zapytać dodając do adresu page={numer_strony}. Przykładowo, dla sytuacji gdzie jest więcej niż 1000 rekordów stosujemy:
www.{twoja_nazwa}.ccrm.pl/publicApi/organisations?page=2
Struktura odpowiedzi
Właściwość |
Wartość |
Opis |
success |
bool |
Wartość identyfikująca rekord. |
data.name |
string |
Nazwa organizacji. |
data.avatar |
string | null |
Nazwa pliku z avatarem. |
data.description |
string | null |
Opis. |
data.nip |
string | null |
Numer NIP. |
data.regon |
string | null |
Numer REGON. |
data.otherRegistryId |
string | null |
Identyfikator dla innego rejestru (inny niż KRS, CEIDG, REGON) |
data.registry |
string | null | in: CEIDG, KRS, REGON, Inne |
Rejestr. |
data.legalForm |
string | null | in: Jednoosobowa działalność gospodarcza, Spółka cywilna, Spółka jawna, Fundacja itd. |
Forma działalności. |
data.legalFormName |
string | null |
Nazwa działalności. |
data.registryName |
string | null |
Nazwa rejestru. |
data.court |
string | null |
Sąd prowadzący rejestr. |
data.active |
int | null in:0,1 |
Status aktywności organizacji. |
data.courtDepartment |
string | null |
Wydział. |
data.krsNumber |
string | null |
Numer KRS. |
data.representation |
string | null |
Reprezentacja. |
phone1 |
string | null |
Numer telefonu. |
phone1Name |
string | null |
Nazwa numeru telefonu. |
phone2 |
string | null |
Numer telefonu. |
phone2Name |
string | null |
Nazwa numeru telefonu. |
phone3 |
string | null |
Numer telefonu. |
phone3Name |
string | null |
Nazwa numeru telefonu. |
email1 |
string | null |
Adres e-mail. |
email1Name |
string | null |
Nazwa adresu e-mail. |
email2 |
string | null |
Adres e-mail. |
email2Name |
string | null |
Nazwa adresu e-mail. |
email3 |
string | null |
Adres e-mail. |
email3Name |
string | null |
Nazwa adresu e-mail. |
uuid |
string | null |
Wartość identyfikująca rekord. |
data.address1 |
object |
Tabela pomocnicza: address. |
data.address2 |
object |
Tabela pomocnicza: address. |
data.address3 |
object |
Tabela pomocnicza: address. |
data.people |
array |
Tabela pomocnicza: people. |
data.flags |
array |
Tabela pomocnicza: flag. |
data.supervisors |
array |
Tabela pomocnicza: supervisor. |
data.CustomValue |
array |
Tabela pomocnicza: customValue. |
otherData.totalCount |
int |
Ilość organizacji |
message |
string |
|
Tabela pomocnicza: address
Właściwość |
Wartość |
Opis |
uuid |
uuid |
Wartość identyfikująca rekord. |
name |
string |
Nazwa adresu. |
street |
string | null |
Ulica. |
buildingNo |
string | null |
Budynek. |
localNo |
string | null |
Lokal. |
postcode |
string | null |
Kod pocztowy. |
city |
string | null |
Miasto. |
voivodeship |
string | null |
Województwo. |
country |
string | null |
Kraj. |
district |
string | null |
Powiat. |
Tabela pomocnicza: people
Właściwość |
Wartość |
Opis |
uuid |
uuid |
Wartość identyfikująca rekord. |
firstName |
string | null |
Pierwsze imię. |
lastName |
string | null |
Nazwisko. |
phone1 |
string | null |
Numer telefonu. |
phone1Name |
string | null |
Nazwa numeru telefonu. |
phone2 |
string | null |
Numer telefonu. |
phone2Name |
string | null |
Nazwa numeru telefonu. |
phone3 |
string | null |
Numer telefonu. |
phone3Name |
string | null |
Nazwa numeru telefonu. |
email1 |
string | null |
Adres e-mail. |
email1Name |
string | null |
Nazwa adresu e-mail. |
email2 |
string | null |
Adres e-mail. |
email2Name |
string | null |
Nazwa adresu e-mail. |
email3 |
string | null |
Adres e-mail. |
email3Name |
string | null |
Nazwa adresu e-mail. |
role |
string in:watcher,manager |
Pełniona funkcja (manager- opiekun/ watcher- obserwator). |
Tabela pomocnicza: flag
Właściwość |
Wartość |
Opis |
uuid |
uuid |
Wartość identyfikująca rekord. |
name |
string |
Nazwa flagi. |
color |
string |
Kolor flagi. |
reluuid |
uuid |
Wartość identyfikująca powiązanie flagi z osobą kontaktową. |
Tabela pomocnicza: supervisor
Właściwość |
Wartość |
Opis |
uuid |
uuid |
Wartość identyfikująca rekord. |
role |
string in:watcher,manager |
Pełniona funkcja (watcher- obserwator, manager- opiekun). |
useruuid |
uuid |
Wartość identyfikująca użytkownika. |
firstName |
string |
Imię. |
lastName |
string |
Nazwisko. |
extension |
int |
Numer SIP. |
workNumber |
string |
Numer służbowy. |
|
string |
Adres email. |
Tabela pomocnicza: customValue
Właściwość |
Wartość |
Opis |
uuid |
uuid |
Wartość identyfikująca rekord. |
type |
string |
Typ własnego pola. |
value |
string |
Wartość własnego pola. |
Przykład odpowiedzi
{
"success":true,
"data":[
{
"name":"testowafirma Sp. z o.o.",
"avatar":null,
"description":"Opis firmy testowej",
"nip":9999999999,
"regon":"",
"otherRegistryId":null,
"registry":null,
"legalForm":null,
"legalFormName":null,
"registryName":null,
„court":null,
„active”:null,
"courtDepartment":null,
"krsNumber":null,
"representation":null,
"email1":"jkowalski@firmatestowa.pl",
"email2":null,
"email3":null,
"email1Name":"Ogólny 1",
"email2Name":null,
"email3Name":null,
"phone1":"+48 666 999 888",
"phone2":"",
"phone3":"",
"phone1Name":"Ogólny 1",
"phone2Name":null,
"phone3Name":null,
"uuid":"e06d8e0d-84fd-401c-9166-9dbleyfdce03",
"address1":{
"uuid":"1d122a29-50a3-9999-bb2c-8c91e57e0972",
"name":"Adres siedziby",
"street":"Mikołowska",
"buildingNo":13,
"localNo":2,
"postcode":"44-199",
"city":"Gliwice",
"voivodeship":"śląskie",
"country":"Polska",
"district":null
},
"address2":{
"uuid":"42f872ad-91bd-48c9-8bdd-a3b7312ef6b5",
"name":"Adres korespondencyjny",
"street":null,
"buildingNo":null,
"localNo":null,
"postcode":null,
"city":null,
"voivodeship":null,
"country":null,
"district":null
},
"address3":{
"uuid":"a3ee1516-1d94-4a2a-a8ae-5eec82cc90b8",
"name":"Adres dodatkowy",
"street":null,
"buildingNo":null,
"localNo":null,
"postcode":null,
"city":null,
"voivodeship":null,
"country":null,
"district":null
},
"people":[
{
"uuid":"c670824b-03a5-404a-839b-513a3e3b060e",
"firstName":"Janusz",
"lastName":"Kowalski",
"phone1":"+48 777 888 999",
"phone1Name":"Służbowy",
"phone2":"",
"phone2Name":null,
"phone3":"",
"phone3Name":null,
"email1":null,
"email1Name":null,
"email2":null,
"email2Name":null,
"email3":null,
"email3Name":null,
"role":null
}
],
"flags":[
{
"name":"Korporacja",
"uuid":"ce35e673-c87a-4250-b63f-7e61d1a3b663",
"color":"#1fbc9c",
"reluuid":"88cccfd4-c9f5-49da-9023-5a98c90935ed"
},
],
"supervisors":[
{
"uuid":"caef28a3-87c4-4939-860e-6f78755dfd6a",
"role":"manager",
"useruuid":"431bde18-c17b-495b-80be-e234d1ac587c",
"firstName":"Jan",
"lastName":"Mazurek",
"extension":13,
"workNumber":"",
"email":"jmazurek@innafirma.pl"
},
],
"customValue":[
{
"uuid":"52b671a0-937b-4160-99bb-ca1ad5693255",
"type":"select",
"param":{
"type":"select",
"name":"Lista wyboru",
"required":false,
"contactType":[
"person",
"organisation"
],
"isMultiple":false,
"options":[
"Tak",
"Nie"
],
"uuid":"52b671a0-937b-4160-99bb-ca1ad5693255"
},
"value":null
},
]
},
],
"otherData":{
"totalCount":4
},
"message":"OK"
}
2. Dodanie nowego kontaktu- organizacji
Metoda pozwala na dodanie organizacji do bazy kontaktów w CRM.
Metoda: POST
Adres URL: www.{twoja_nazwa}.ccrm.pl/publicApi/organisations
Struktura żądania
Właściwość |
Wartość |
Opis |
name |
required | max:256 | string |
Nazwa. |
description |
null | max:65535 | string |
Opis. |
phone1 |
null | phone |
Numer telefonu. |
phone1Name |
null | string | max:128 |
Nazwa numeru telefonu. |
phone2 |
null | phone |
Numer telefonu. |
phone2Name |
null | string | max:128 |
Nazwa numeru telefonu. |
phone3 |
null | phone |
Numer telefonu. |
phone3Name |
null | string | max:128 |
Nazwa numeru telefonu. |
email1 |
null | max:128 | email |
Adres e-mail. |
email1Name |
null | string | max:128 |
Nazwa adresu e-mail. |
email2 |
null | max:128 | email |
Adres e-mail. |
email2Name |
null | string | max:128 |
Nazwa adresu e-mail. |
email3 |
null | max:128 | email |
Adres e-mail. |
email3Name |
null | string | max:128 |
Nazwa adresu e-mail. |
nip |
null | max:32 | NIP |
Numer NIP. |
regon |
null | max:32 | Regon |
Numer REGON. |
registry |
null | max:256 | string |
Rejestr wpisu działalności. |
addresses |
null | array |
Tabela pomocnicza: address - request data. |
people |
null | array |
Tabela pomocnicza: people - request data. |
supervisors |
null | array |
Tabela pomocnicza: supervisor - request data. |
customFields |
null | array |
Tabela pomocnicza: customField - request data. |
avatar |
null | string | uuid |
uuid avataru |
Tabela pomocnicza: address - request data
Właściwość |
Wartość |
Opis |
name |
required | max:128 | string |
Nazwa adresu. |
street |
null | max:128 | string |
Ulica. |
city |
null | max:64 | string |
Miasto. |
postcode |
null | max:16 | string |
Kod pocztowy. |
building_no |
null | max:16 | string |
Budynek. |
local_no |
null | max:16 | string |
Lokal. |
voivodeship |
null| max:64 | string |
Województwo. |
country |
null | max:64 | string |
Kraj. |
name |
required | max:128 | string |
Nazwa adresu. |
street |
null | max:128 | string |
Ulica. |
district |
null | max:64 | string |
Powiat. |
Tabela pomocnicza: people - request data
Właściwość |
Wartość |
Opis |
uuid |
uuid |
Uuid osoby kontaktowej (kontaktu- osoby powiązanej z organizacją). |
Tabela pomocnicza: supervisor - request data
Właściwość |
Wartość |
Opis |
user |
uuid |
Uuid użytkownika CRM. |
role |
required | string | in: watcher, manager |
Rola przypisanego użytkownika. |
Tabela pomocnicza: customField - request data
Właściwość |
Wartość |
Opis |
uuid |
uuid |
Uuid własnego pola. |
Przykład żądania
{
"name":"Firma XYZ",
"nip":"9518767503",
"description":"Opis firmy XYZ",
"registry":"CEIDG",
"phone1":"48221131416",
"phone1Name":"Numer 1",
"email1":"firmaxyz@firmaxyz.pl",
"email1Name":"Email 1",
"customFields":[
{
"uuid":"96d8ad7a-ffef-4b5f-a38f-f21e7c8bb97e",
"value":"12"
},
{
"uuid":"183619e0-af10-4584-b260-bd81324a6ec2",
"value":[
"cd"
]
},
{
"uuid":"5e4d85b1-5e37-4cd9-8fd5-21e8e5ed4e0f",
"value":"7"
}
],
"people":[
"b4919840-dceb-4dfb-b6dc-72ded87c0077"
],
"addresses":[
{
"buildingNo":"15",
"city":"Gliwice",
"country":"Polska",
"localNo":"4",
"postcode":"44-100",
"street":"Makoszowska",
"voivodeship":"łódzkie",
"district":"pabianicki",
"name":"Adres siedziby"
},
{
"buildingNo":"8",
"city":"Gliwice",
"country":"Polska",
"localNo":"2",
"postcode":"44-100",
"street":"Bydgoska",
"voivodeship":"małopolskie",
"district":"nowotarski",
"name":"Adres korespondencyjny"
},
{
"buildingNo":"99",
"city":"Gliwice",
"country":"Polska",
"localNo":"1",
"postcode":"44-100",
"street":"Podkarpacka",
"voivodeship":"mazowieckie",
"district":"nowodworski",
"name":"Adres dodatkowy"
}
],
"supervisors":[
{
"role":"manager",
"user":"f6e4999b-6292-45ab-bb02-20b2e9284280"
},
{
"role":"watcher",
"user":"34b1f634-65e9-4b9a-bec8-b8de541a580a"
}
]
}
Struktura odpowiedzi
Jak w przypadku metody na pobranie pobranie listy kontaktów- osób zapisanych w CRM (pkt 1).
Przykład odpowiedzi
{
"success":true,
"data":{
"name":"Firma XYZ",
"avatar":null,
"description":"Opis firmy XYZ",
"nip":9518767503,
"regon":"",
"active":null,
"otherRegistryId":null,
"registry":"CEIDG",
"legalForm":null,
"legalFormName":null,
"registryName":null,
"court":null,
"courtDepartment":null,
"krsNumber":null,
"representation":null,
"email1":"firmaxyz@firmaxyz.pl",
"email2":null,
"email3":null,
"email1Name":"Email 1",
"email2Name":null,
"email3Name":null,
"phone1":"+48 22 113 14 16",
"phone2":"",
"phone3":"",
"phone1Name":"Numer 1",
"phone2Name":null,
"phone3Name":null,
"uuid":"75589e9b-171b-4d1f-a0b7-2d808e491d93",
"address1":{
"uuid":"31617331-7913-4fc7-b997-8bc1470fcd47",
"name":"Adres siedziby",
"street":"Makoszowska",
"buildingNo":15,
"localNo":4,
"postcode":"44-100",
"city":"Gliwice",
"voivodeship":"łódzkie",
"country":"Polska",
"district":"pabianicki"
},
"address2":{
"uuid":"34ea0bb2-5c9f-480f-beec-f7b3897fd44a",
"name":"Adres korespondencyjny",
"street":"Bydgoska",
"buildingNo":8,
"localNo":2,
"postcode":"44-100",
"city":"Gliwice",
"voivodeship":"małopolskie",
"country":"Polska",
"district":"nowotarski"
},
"address3":{
"uuid":"95fba500-56f8-4ee6-a14f-95626ff461f9",
"name":"Adres dodatkowy",
"street":"Podkarpacka",
"buildingNo":99,
"localNo":1,
"postcode":"44-100",
"city":"Gliwice",
"voivodeship":"mazowieckie",
"country":"Polska",
"district":"nowodworski"
},
"people":[
{
"uuid":"b4919840-dceb-4dfb-b6dc-72ded87c0077",
"firstName":"Rafał",
"lastName":"Sobota",
"phone1":"+48 222 333 444",
"phone1Name":null,
"phone2":"",
"phone2Name":null,
"phone3":"",
"phone3Name":null,
"email1":null,
"email1Name":null,
"email2":null,
"email2Name":null,
"email3":null,
"email3Name":null,
"role":null
}
],
"flags":{
},
"customValue":[
{
"uuid":"7b0abc08-afa4-4946-ad23-ad4646072853",
"type":"date",
"param":{
"type":"date",
"name":"Data zamówienia",
"required":true,
"contactType":[
"person",
"organisation"
]
},
"value":null
},
{
"uuid":"c894f58b-fe44-4afa-9776-bf44bf820bf5",
"type":"checkbox",
"param":{
"type":"checkbox",
"name":"checkbox",
"required":false,
"contactType":[
"person",
"organisation"
]
},
"value":false
},
{
"uuid":"5e4d85b1-5e37-4cd9-8fd5-21e8e5ed4e0f",
"type":"number",
"param":{
"type":"number",
"name":"Pole numeryczne",
"required":true,
"contactType":[
"person",
"organisation"
],
"minValue":0,
"maxValue":100
},
"value":7
}
]
},
"otherData":{
"totalCount":1
},
"message":"OK"
}
3. Edycja istniejącego kontaktu- organizacji
Metoda pozwala na edytowanie istniejącej organizacji w bazie kontaktów CRM.
Metoda: PATCH
Adres URL: www.{twoja_nazwa}.ccrm.pl/publicApi/organisations/{uuid}
Struktura żądania
Jak w przypadku metody na dodanie nowego kontaktu- organizacji (pkt 2).
Przykład żądania
{
"name":"Moja nowa firma",
"nip":"7311852569",
"description":"Nowy opis",
"phone1":"48333666999",
"phone1Name":"Służbowy",
"phone2":"",
"phone2Name":"",
"phone3":"",
"phone3Name":"",
"email1":"",
"email1Name":"",
"email2":"",
"email2Name":"",
"email3":"",
"email3Name":"",
"registry":"",
"legalForm":"",
"regon":"",
"representation":""
}
Struktura odpowiedzi
Jak w przypadku metody na pobranie pobranie listy kontaktów- osób zapisanych w CRM (pkt 1).
Przykład odpowiedzi
{
"success":true,
"data":{
"name":" Moja nowa firma ",
"avatar":"",
"description":"Nowy opis",
"nip":"7311852569",
"regon":"",
"active":null,
"otherRegistryId":null,
"registry":null,
"legalForm":null,
"legalFormName":null,
"registryName":null,
"court":null,
"courtDepartment":null,
"krsNumber":null,
"representation":null,
"email1":null,
"email2":null,
"email3":null,
"email1Name":null,
"email2Name":null,
"email3Name":null,
"phone1":"+48 333 666 999",
"phone2":"",
"phone3":"",
"phone1Name":null,
"phone2Name":null,
"phone3Name":null,
"uuid":"94096f48-29d3-43fe-a3d5-7ec35f1526dd",
"people":{
},
"customValue":null
},
"otherData":{
},
"message":"OK"
}
4. Usunięcie istniejącego kontaktu- organizacji
Metoda pozwala na usunięcie istniejącej organizacji w bazie kontaktów CRM.
Metoda: DELETE
Adres URL: www.{twoja_nazwa}.ccrm.pl/publicApi/organisations/{uuid}
Struktura odpowiedzi
Właściwość |
Wartość |
Opis |
success |
bool |
|
data |
string |
|
otherData.totalCount |
int |
Ilość usuniętych rekordów. |
message |
string |
|
Przykład odpowiedzi
{
"success":true,
"data":"OK",
"otherData":{
"totalCount":1
},
"message":"OK"
}