Aşağıdaki adımları takip ederek bir Logo CRM REST istemcisi oluşturabilirsiniz. Buradaki örnekler için Postman ya da başka bir istemci kullanılabilir.

Logo CRM REST uygulamasının Veritabanı bağlantı bilgileri uygulama dizinindeki web.config de tutulur. ConnectionString'in Logo CRM ile aynı olmasına dikkat ediniz.

Logo CRM Tarafından Sunulan Kaynaklar

Logo CRM REST Service Arayüzleri

Logo REST Sunucusu


Login (POST)

IIS 10.0 Detailed Error - 404.0 - Not Found şeklinde bir hata alırsanır. URL'i kontrol ediniz.

http post kullanılarak login olabilirsiniz. Login başarılı olursa sessionid üretilecektir. Daha sonraki işlemler için bu id'yi kullanacaksınız.


1.49 sürümünden itibaren Login'de kullanılan paramertreler base64Encoded olarak POST edilerek kullanılacaktır.


1.49 Versiyonu Sonrası Login

Parametreler base64Encoded olarak "authorization" query name ile POST edilir: 

POST
http://localhost/LogoCRMRest/api/v1.0/login?authorization=TE9HTzpMb2dvKyZMb2dvOnRydWU6dHI6ZmFsc2U=


Example Authorization (Base64 encode için : https://www.base64decode.org/)

  •  Basic BASE64Encode(LOGO:Logo)
  •  Basic BASE64Encode(LOGO:Logo:true)
  •  Basic BASE64Encode(LOGO:Logo:true:tr)
  •  Basic BASE64Encode(LOGO:Logo:true:tr:false) 

1.49 Versiyonu Öncesi Login  

POST
Örnek1 : logoCrmRestServer/api/v1.0/login?username=LOGO&password=LOGO
Örnek2 : http://localhost/LogoCrmRest/api/v1.0/login?username=LOGO
Örnek3 : http://localhost/LogoCRMRest/api/v1.0/login?userName=LOGO&passWord=Logo&allowImages=true&language=tr&isDetailedLogin=false
Login Response (Dikkat "SessionId": "fff63884-ffe6-41e4-b15f-e77f9648720d")
{
    "Meta": null,
    "Result": 1,
    "Message": "",
    "SessionId": "fff63884-ffe6-41e4-b15f-e77f9648720d",
    "WarningMessage": null,
    "User": "83d88925-e89c-498e-a8d0-f59d91fb1baa",
    "Integration_Connected": true,
    "Integration_SetOid": "",
    "Integration_ApplicationType": -1,
    "Integration_ApplicationName": "",
    "Integration_FirmNumber": "",
    "Integration_Description": "",
    "Integration_BranchCode": "",
    "Integration_BranchName": "",
    "IsUserAdmin": true,
    "RESTApiVersion": "1.42",
    "ClearDescribe": false,
    "AccessRights": [],
    "SalesRepRights": [],
    "NavigationMenuNames": {
        "MT_Shares": ""
    },
    "NavigationItems": [],
    "XMLSettings": {
        "flag_DontUseDistanceWhenCheckIn": "0"
    }
}

Firma Listesi Alma (GET)


{
    "Meta": {
        "href": "localhost/LogoCrmRest/api",
        "mediaType": "application/json; charset=UTF-8",
        "fullPath": "/LogoCrmRest/api/v1.0/firms",
        "apiVersion": "1"
    },
    "Result": 1,
    "Message": "",
    "Items": [
        {
            "Oid": "25284038-b655-4bd9-ae00-e0c95d07390d",
            "FirmCode": "00000001",
            "FirmTitle": "logo",
            "InUse": true,
            "IsPersonCompany": true,
            "PersonId": null,
            "TaxOffice": null,
            "TaxNo": null,
            "EmailAddress1": null,
            "EmailAddress2": null,
            "EmailAddress3": null,
            "WebAddress1": null,
            "WebAddress2": null,
            "Latitude": 0,
            "Longtitude": 0,
            "Notes": null,
            "Tags": null,
            "NotifyUsers": null,
            "PhotoBase64": "iVBORw0KGgoAAAANSUhEUgAAAHg.....
            "_CreatedDateTime": "2017-12-05T15:47:24.533",
            "_LastModifiedDateTime": "2017-12-05T15:47:24.537",
            "RecordCreateInfo": "System Administrator, 05.12.2017 15:47",
            "RecordLastUpdateInfo": "System Administrator, 05.12.2017 15:47"
        },
        {
            "Oid": "519fcb53-6d8d-4e8f-8ee1-b42844e46250",
            "FirmCode": "00000003",
            "FirmTitle": "logo elektronik",
            "InUse": true,
            "IsPersonCompany": false,
            "PersonId": null,
            "TaxOffice": null,
            "TaxNo": null,
            "EmailAddress1": null,
            "EmailAddress2": null,
            "EmailAddress3": null,
            "WebAddress1": null,
            "WebAddress2": null,
            "Latitude": 0,
            "Longtitude": 0,
            "Notes": null,
            "Tags": null,
            "NotifyUsers": null,
            "PhotoBase64": "iVBORw0KGgoAAAA....
            "_CreatedDateTime": "2017-12-05T15:47:50.07",
            "_LastModifiedDateTime": "2017-12-05T15:47:50.07",
            "RecordCreateInfo": "System Administrator, 05.12.2017 15:47",
            "RecordLastUpdateInfo": "System Administrator, 05.12.2017 15:47"
        }
    ]
}

Belirli bir firmayı getirmek için ilgili firmanın Oid bilgisi verilmelidir.

http://localhost/LogoCrmRest//api/v1.0/firms/f948d46e-f578-4058-9d16-d65439fe14d6?SessionId=b3c08db9-a021-4972-b24b-9a6fa9778539


Firma Ekleme (POST)

Firma ya da başka bir iş nesnesi GET ile alındıktan sonra ilgili alanları doldurulup gönderilerek POST yapılabilir.

"Oid" sistem tarafından otomatik olarak oluşturulmaktadır. Aşağıdaki gibi bir tanım ile firma eklenebilir.

{
            "FirmCode": "00000004",
            "FirmTitle": "REST Firm",
            "InUse": true,
            "IsPersonCompany": true,
            "PersonId": null,
            "TaxOffice": null,
            "TaxNo": null,
            "EmailAddress1": null,
            "EmailAddress2": null,
            "EmailAddress3": null,
            "WebAddress1": null,
            "WebAddress2": null,
            "Latitude": 0,
            "Longtitude": 0,
            "Notes": null,
            "Tags": null,
            "NotifyUsers": null,
            "PhotoBase64": "iVBORw0KGgoAAA...",
            "_CreatedDateTime": "2017-12-05T15:47:24.533",
            "_LastModifiedDateTime": "2017-12-05T15:47:24.537",
            "RecordCreateInfo": "System Administrator, 05.12.2017 15:47",
            "RecordLastUpdateInfo": "System Administrator, 05.12.2017 15:47"
}

Destek Maddesi Ekleme (POST)

Veri deseni için öncelikle tickets lar örnek olarak alınabilir. Sonrasında ilgili kayıt oluşturulup sessionid ile POST etmek yeterli olacaktır.

{
    "Meta": {
        "href": "localhost/LogoCrmRest/api",
        "mediaType": "application/json; charset=UTF-8",
        "fullPath": "/LogoCrmRest/api/v1.0/ticketstates",
        "apiVersion": "1"
    },
    "Result": 1,
    "Message": "",
    "Items": [
        {
            "Oid": "8e632b29-4fb9-472c-8aea-25b54a74cfe2",
            "TicketStateDescription": "Aktif",
            "IsActive": true,
            "IsCompleted": false,
            "_CreatedDateTime": "2017-12-15T14:50:41.01",
            "_LastModifiedDateTime": "2017-12-15T14:50:41.013"
        }
    ]
}
{
    "Meta": {
        "href": "localhost/LogoCrmRest/api",
        "mediaType": "application/json; charset=UTF-8",
        "fullPath": "/LogoCrmRest/api/v1.0/tickets",
        "apiVersion": "1"
    },
    "Result": 1,
    "Message": "",
    "Items": [
        {
            "Oid": "155710dc-7ccb-4622-87f2-04b455d8bf5d",
            "TicketId": "T-000003",
            "TicketDescription": null,
            "TicketMainCategory": null,
            "TicketSubCategory": null,
            "TicketType": null,
            "TicketFirm": {
                "Oid": "c64aef6e-59c0-4f76-b8f7-a757bce63c05",
                "FirmCode": "00000003",
                "FirmTitle": "firma 2",
                "InUse": true,
                "IsPersonCompany": false,
                "PersonId": null,
                "TaxOffice": null,
                "TaxNo": null,
                "EmailAddress1": null,
                "EmailAddress2": null,
                "EmailAddress3": null,
                "WebAddress1": null,
                "WebAddress2": null,
                "Networks_": {
                    "Oid": "a691d1a9-9014-4531-8023-24768edbc4e0",
                    "smFacebook": null,
                    "smTwitter": null,
                    "smInstagram": null,
                    "smGooglePlus": null,
                    "smLinkedIn": null,
                    "smSkype": null,
                    "smYoutube": null
                },
                "Latitude": 0,
                "Longtitude": 0,
                "SalesRep": null,
                "MainSector": null,
                "SubSector": null,
                "FirmRole": null,
                "Notes": null,
                "Tags": null,
                "NotifyUsers": null,
                "FirmCategory01": null,
                "FirmCategory02": null,
                "FirmCategory03": null,
                "FirmCategory04": null,
                "FirmCategory05": null,
                "ReferenceSource": null,
                "ParentFirm": null,
                "RecordCreateInfo": "System Administrator, 15.12.2017 14:49",
                "RecordLastUpdateInfo": "System Administrator, 15.12.2017 14:49"
            },
            "TicketContact": null,
            "Priority": 2,
            "TicketStartDate": "2017-12-15T14:50:05.823",
            "TicketCompletedDate": "1900-01-01T00:00:00",
            "TicketEstEndDate": "1900-01-01T00:00:00",
            "AssignedTo": null,
            "AssignedDepartment": null,
            "TicketState": {
                "Oid": "8e632b29-4fb9-472c-8aea-25b54a74cfe2",
                "TicketStateDescription": "Aktif",
                "IsActive": true,
                "IsCompleted": false
            },
            "IsCompleted": false,
            "Notes": null,
            "Tags": null,
            "NotifyUsers": null,
            "RecordCreateInfo": "System Administrator, 15.12.2017 14:50",
            "RecordLastUpdateInfo": "System Administrator, 15.12.2017 14:50"
        }
    ]
}
 {
            "TicketDescription": "REST test",
            "Priority": 2,
            "TicketStartDate": "2017-12-15T14:50:05.823",
            "TicketCompletedDate": "1900-01-01T00:00:00",
            "TicketEstEndDate": "1900-01-01T00:00:00",
            "IsCompleted": false,
   	"TicketState": {
                "Oid": "8e632b29-4fb9-472c-8aea-25b54a74cfe2",
            },
            "Notes": null,
            "Tags": null,
            "NotifyUsers": null,
            "_CreatedDateTime": "2017-12-15T14:50:45.823",
            "_LastModifiedDateTime": "2017-12-15T14:50:45.837",
            "RecordCreateInfo": "System Administrator, 15.12.2017 14:50",
            "RecordLastUpdateInfo": "System Administrator, 15.12.2017 14:50"
}

Logo CRM de tanımlı bir durumun destek kaydı içinde gönderilmesi zorunludur.

Comment (GET)

Yorumları listelemek için; 

GET isteği ile http://localhost/LogoCRMRest/api/v1.0/comments/ObjectKey?sessionId=04cfad92-0f1f-4199-a1bb-f6cfb7f75862 URL i kullanılır. Buradaki "ObjectKey" parametresi yorumları listelenmek istenilen kaydın ObjectKey'idir. 

Örneğin aktivite detayındaki yorumları listelemek istersek Aktivite detayındaki objectKey'i almamız gerekir.

 http://localhost/LOGOCRM/Default.aspx#ViewID=MT_Activity_DetailView&ObjectKey=5020baaf-7482-4a76-8119-9e798d10a3d2&ObjectClassName=logocrm.net.Module.BusinessObjects.MT_Activity&mode=Edit

http://localhost/LogoCRMRest/api/v1.0/comments/5020baaf-7482-4a76-8119-9e798d10a3d2?sessionId=04cfad92-0f1f-4199-a1bb-f6cfb7f75862


Comment (POST)

Yorum eklemek için; 

POST isteği ile http://localhost/LogoCRMRest/api/v1.0/comments?sessionId=04cfad92-0f1f-4199-a1bb-f6cfb7f75862 URL i kullanılır. Body kısmındaki zorunlu alanlar aşağıdaki şekildedir. Burada "content" eklenmek istenilen yorum, "object id" hangi nesneye yorum eklenmek isteniyorsa onun Oid bilgisi, "moduleName" hangi module eklenecekse onun adıdır. 


{ 
    "content": "rest ile yorum", 
    "created": "2019-02-20 08:53:04.573", 
    "modified": "2019-02-20 08:53:04.573", 
    "moduleName": "MT_Activity", 
    "objectId": "92c0b194-f24c-4c30-a64d-cc0382b8300b" 
}

Yorum beğenmek için; 
POST isteği ile  http://localhost/LogoCRMRest/api/v1.0/comments/upVoteComment?sessionId=04cfad92-0f1f-4199-a1bb-f6cfb7f75862 URL i kullanılır. Body ise 


    "objectId": "7b4da874-8b56-41e9-9b57-f8813889aeae", 
    "id" : "1" 

şeklindedir. Burada objectId hangi nesne olduğunu ve id ise hangi yorum olduğunu belirtir. Bu parametrelere bakılarak yorum beğenilir veya daha önce beğenilmiş ise beğeni geri alınır. 

Ön koşul olarak kullanıcının login olup sessionId aldığı kabul edilmiştir. Ayrıca hem rest hem de web için yorum fonksiyonları test edilirken id lerin veritabanına da doğru kaydedildiğinden emin olunmalıdır.


Comment (PUT)

Yorum güncellemek için; 

PUT isteği ile http://localhost/LogoCRMRest/api/v1.0/comments?sessionId=04cfad92-0f1f-4199-a1bb-f6cfb7f75862 URL i kullanılır. Body ise aşağıdaki şekildedir. Burada content yorumun düzenlenen hali, objectId düzeltilecek nesnenin Oid bilgisi, id ise hangi yorumun düzeltileceğini belirtir. 


{ 
    "content": "yorum ekleme düzenlendi", 
    "objectId": "6c65e7cf-aac8-4df7-b7ec-7b24e2f3ece3", 
    "id" : "1" 
} 

Comment (DELETE)

Yorum silmek için; 
DELETE isteği ile http://localhost/LogoCRMRest/api/v1.0/comments?sessionId=04cfad92-0f1f-4199-a1bb-f6cfb7f75862 URL i kullanılır. Body ise aşağıdaki şekildedir. Burada objectId hangi nesne olduğunu ve id ise hangi yorum olduğunu belirtir. Bu parametrelere bakılarak silme işlemi yapılır. 


{ 
    "objectId": "6c65e7cf-aac8-4df7-b7ec-7b24e2f3ece3", 
    "id" : "1" 
} 


Logout