Erişim Bilgileri

Adres: http://yenifaks.telsam.com.tr/api/v1

Body içerik tipi: application/json

Parola için yetkilendirme jetonu alma

Kimlik doğrulama için Jeton Alma metodu çağırılarak bir adet erişim jetonu (“access token”) ve yenileme jetonu (“refresh token”) alınır. username, password, client_id ve client_secret değerleri arayüzde oluşturulan api kullanıcısına ait değerlerdir.

				
					http://yenifaks.telsam.com.tr/api/v1/oauth/token
				
			

(HTTP METHOD: POST)

Request Body Schema

grant_type: “password”
username: API kullanıcı adınız
password: API kullanıcı şifreniz
client_id: API client id’si
client_secret: API client secret

Örnek İstek
				
					{
    "grant_type" : "password",
    "username": "kullanıcı adı",
    "password": "şifre",
    "client_id": "client_id",
    "client_secret": "client secret"
}

				
			
Örnek Başarılı Yanıt

HTTP Status Code: 200

				
					{
    "token_type": "Bearer",
    "expires_in": 31536000,
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYmUxNmRiMmEzNmY0M2NlNTdkNTNhOWIxYWFkYmNiODBmMDcyYTE0OWVmYWM1NmZmMDk3OTNhYWE3MDcyMzVjNTNiM2QyZGYxNDc4YWU4NDciLCJpYXQiOiIxNjE0NjA1MTg2LjMwODcxNCIsIm5iZiI6IjE2MTQ2MDUxODYuMzA4NzE5IiwiZXhwIjoiMTY0NjE0MTE4Ni4wNjcwNjAiLCJzdWIiOiIxOSIsInNjb3BlcyI6W119.hfWEsbiV2DCYvytrewq-5OIdsTPqBOmJebPeqgY0aPGY1Ky7ngLgPmyQvh4oztuVU5Chzj0fGI7SiuwwDOnmkDBipfDIGv1IcJA7mPoAxZ2EBBAwlgs7YIcemEhJOKgYCcVIUB8NAYCgMGpozqAEI4Zyz1bR5G8GcfUIyhEAKm2Ky0_m04jCBZ6efGSecCGU4qLWZMLRUsGcQTaUNVefi7l5bB4wkHFUveLbjywXXnGhFr_Q94M1KbHX2XzC3AYwxaP2zqja_Us78KO1jgII66eSLZ9fczHO0EruKd0J8e4KVl1d8qU0pu5rIPM-VCsxjXfRMVq7t6xTAeTp7MchOZOgQ7DDBCq6OAFt4t7T5CY4E3NSiUqJOSsctvKyv9xX_oPd1cRqe7CT_Pw0aOmNHaYQk1J1U8aZBKszeFg7S4KR-426bj-DMvuDoVjJF1yIPIliUrC9cLkwynmjdBbUomf3TPvujOaVMqFDmcyz8Brk074tbj9VXmxcO9YidT12OPJMXlEcIzlDMlQaI3Dax6i_Ngfz8i_q-crzdiA46x95MkMgP0HRPcBBAdjjlYSvjw3IEj1EhUN6uQUAQcZ6xsujq56MtE2SzOtc6_h0-gM5vbEvEpOo-osuh06vAFqAeouQm_faCqON6pfNGFWAH-R7vWVZYyfqE6kbMQXb_to",
    "refresh_token": "def50200b7484d580082e42439b4934c0ca9aeab07c83530df0707d90cc641b868e850342a5903f91bd57e7829a172e705d74a4afee34452731e8dc18bef2e3012a719edce95afc5e412b915047602478ecfc47cab13f565570920555a0d8d5a6c8331a33d5f94fec2d11099cada9d9309eb3118f61b38f25a17c40fdd6ae86faabcceaeb920460d4a1fd2b28a837975adbb853266458fee1d44683cb932684b2c5d678497f766a408bdf18fa32ea595b1f833cbc8e4cd010b9b4639a53cd777271dc5d73b51d5d9707107da8114aad92e6c7912f852863fe36c8df85d46d25dbcb2e7c27f905679669ee63c821fd7406e7bcc993222c3640b84adb15ba807ada8ebc1367bc6792ed47dad94b171f17539985d9b5d1097ecf0d3c32f3c48699c255ee16bcb88d87c89dafbf9b4e713eda5cb4824bca4bf6be2c51e2ed6b5cb1f75dd78766efaa8dabf378720eb119e38d0f82661729939deb6b6e204a62da196"
}

				
			
Örnek Hatalı Yanıtlar

HTTP Status Code: 400

				
					{
    "error": "unsupported_grant_type",
    "error_description": "The authorization grant type is not supported by the authorization server.",
    "hint": "Check that all required parameters have been provided",
    "message": "The authorization grant type is not supported by the authorization server."
}

				
			

HTTP Status Code: 401

				
					{
    "error": "invalid_client",
    "error_description": "Client authentication failed",
    "message": "Client authentication failed"
}

				
			

HTTP Status Code: 404

				
					{
    "message": "Not Found!"
}

				
			

HTTP Status Code: 500

				
					{
    "message": "Unknown Error"
}

				
			

Oauth2 yetkilendirme jetonu alma

Aşağıdaki verilen görsellerdeki aşamalar izlenerek “code” oluşturulur.

Daha sonra, jeton alma metodu çağırılarak bir adet erişim jetonu (“access token”) ve yenileme jetonu (“refresh token”) alınır. client_id, client_secret, redirect_uri değerleri arayüzde oluşturulan api kullanıcısına ait değerlerdir. Code, kullanıcının girmiş olduğu yönlendirilecek url vasıtasıyla oluşturulmuş değerdir.

http://yenifaks.telsam.com.tr/api/v1/oauth/token

(HTTP METHOD: POST)

Request Body Schema

grant_type: “authorization_code “

client_id: API kullanıcı id’si

client_secret: API anahtarı

redirect_uri: code’un oluşturulduğu uri

code: redirect_uri aracılığıyla oluşturulan code

Örnek İstek
				
					{
    "grant_type": "authorization_code",
    "client_id": 1,
    "client_secret": "z3Kewxm2K6H4stFslvJHqx7kvzasiDKvsvIBQnaX",
    "redirect_uri": "https://example.com/callback",
    "code": "def50200213698b36c6c7e6f3ff5eca3f01e476c31fe50db0f0f70e740f71397f3338a6f84c934ab72652041612f4b0fe5965c1706964cb3ba84d9c9afe92a4ba086670163efc97813eec6c9e4884de1843e1f6eac5786363bdafc6c00d50830ddee16b882cc0b107542166f17e8974397dc035173126d35768db9d6d7dff6a3d4d461636c4c77a2262db99cce6c3f23807222b848e2d060efb2d9284bc06064dd44452fe7891bbe002a6bda19547028433d64321a888b178690bb4ec5a2b4879e7e58c74ad9536ddc37496c798a7b27be7c8afaea53aa81ff49d492486bdb80eff03f8d473cc3fa64204018d81e9a02b5e1236f044bc1548d588df4fde9e5264c7542b282391dabc51e9df61e5e77b50a1582d107d6ebf04c2b45131b12179c65d141f6dd4713d053d58d6cb6d7a9e8ec0c83c9a011b98f0d7ab5e4ff8a801842932be9c941df6ff9c46f9e86ea"
}

				
			
Örnek Başarılı Yanıt

HTTP Status Code: 200

				
					{
    "token_type": "Bearer",
    "expires_in": 31536000,
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIzIiwianRpIjoiZGU3OTk0OWZhOGMzMTU0NGMxYzZlN2U5MDhjM2M0MGY4ZGNhMzAwYmU2YTJmNDliZDA5Yjg0ZmM0NGNkMjNiMmIwY2MyNWI5MWZhkjabdjkafıuw65654646wwhyeyegzNzMiLCJzdWIiOiIiLCJzY29wZXMiOltdfQ.kUek0SiXT3XPFW92ho3rT1WRi3LzP9nLXV5QlFbIrQTbL18mwbQLZ6bGw6ss82VkxKa-orQfV0NIRJorhj8RZbnOz2XPHZDh-59o0znctyo-fhZqsPQP55Cjwa3cFRVRbDXORDESsOoxd38nIzbL2jPk8bk3eaLdmMWGu3uolctN4uQ7_9XxWJZlZIJ4OHbS3JtDX9Z00PG9M9SuM6qbBowTXq4OkCeRIvJaAn88Hr8jBjyc0fnawok4e_sGBaDFpmEAd-3UqSxOZ5Rwytb8VyHfWk-Pm-E6asRr_kyjcXtgE8vzl6_BPHAR2_VV2pCF27MJm9bXGDedygp6tHAkaMg780J4oj9IPPWi5fd0CygeeLsvjiqo6EMrBGZ_y0QL2jLdQ28aIyAoVFNZ1L19Ki7b9R9YNWgeW_izkaenVY6-ptVGzfPo3R5gW4cOihu5pdEbndcmFIjmV5Y87KzO5DcnRM_z0gQn6HwpiBCIkYNyYzjII7nJDKZgg1nu3Lf6MaTxeffIC5RrsLS9OeOKVSf0-xSZryzkzn7o-BmaQjMk9pkRqr2d29z2i4D0ToCXkSFG8uOUb-32U6zbIXsFpgfEk01pjf7zXA76ZbVEf19hrCHyeXSX5kFmWoqEIEI89Go0z7bsb1EqkXOgqxI8mDwgELAcWAULO9B8xK3didU",
    "refresh_token": "def50200d995385b392f69f200657d3593d274375fa9c515bae8b3af214934cb975b2a06666ab4bafc8edeffd59cb00932947f3a89a7a81fd9922375692d3aa9c2fae5cda16d33a31df9b8569777432dfc313886a9e78231df1b47ada8a5f9d2a25f5276f29448e409e7df2dedfd126b937b915fdd662c2b7eae068adec416d6c6f85c5aa7d17ae0276c21e729695cb78c4cb5cc67943d613c55412f592efe50d78b9bc231b768373e3070470a978eb91f3206297fb588391cffe371cdad7af4a5864b21f1e30f6bb46bf8f6b41be9a8d36ac362461251b92189a6fc26e5c73a6d80b7456b7786207ac23c366b55fa03aff2d6aed504b4cefeb19f92c2cf57a5e3ee79dfe12b0818f0770f0598e9f78bac5ba33ac8d8cec00f5ee9b316102619b2fefc8923330f1cd4bb95539a6cdf6118effe5df3ed477155e43a39c32a2c530237a7adec391de050a72349e8d1f06d00b7d690bf1dd4ed313500021c6879d5e6"
}

				
			
Örnek Hatalı Yanıt

HTTP Status Code: 400

				
					{
    "error": "unsupported_grant_type",
    "error_description": "The authorization grant type is not supported by the authorization server.",
    "hint": "Check that all required parameters have been provided",
    "message": "The authorization grant type is not supported by the authorization server."
}

				
			

HTTP Status Code: 401

				
					{
    "error": "invalid_client",
    "error_description": "Client authentication failed",
    "message": "Client authentication failed"
}

				
			

HTTP Status Code: 404

				
					{
    "message": "Not Found!"
}

				
			

HTTP Status Code: 500

				
					{
    "message": "Unknown Error"
}

				
			

Faks Listeleme

Faks listesini almak için kullanılan metottur.

http://yenifaks.telsam.com.tr/api/v1/fax

Listeleme işlemlerinde sayfalama olduğundan dolayı, bir sonraki sayfa verilerini getirmek için istek attığınız url’in get parametresine page değeri vererek işlem yapabilirsiniz.

Örn: http://yenifaks.telsam.com.tr/api/v1/fax?page=2

(HTTP METHOD: POST)

Request Body Schema

status: Enum: ” success” ” pending” ” failed”

type: Enum: ” incoming” “outgoing”

search: Filtrelemek istediğiniz anahtar kelime. ( Telefon numarasında, Faks konusunda, ve Did numaranızın isminde arama yapar. )

start_date: Değer verilmez ise bulunulan günü alır. Formatı YYYY-MM-DD HH:mm:ss şeklinde olmak zorundadır.

end_date: Değer verilmez ise bulunulan günü alır. Formatı YYYY-MM-DD HH:mm:ss şeklinde olmak zorundadır.

Örnek İstek
				
					{
    "start_date" : "2021-11-01 00:00:00",
    "end_date":"2021-12-22 11:11:11",
    "status":"success",
    "type":"incoming",
    "search":"908502590260"
}

				
			
Örnek Başarılı Yanıt

HTTP Status Code: 200

				
					{
    "start_date" : "2021-11-01 00:00:00",
    "end_date":"2021-12-22 11:11:11",
    "status":"success",
    "type":"incoming",
    "search":"908502590260"
}

				
			
Örnek Hatalı Yanıt

HTTP Status Code: 401

				
					{
    "message": "Unauthenticated."
}

				
			

HTTP Status Code: 403

				
					{
    "message": "This action is unauthorized."
}

				
			

HTTP Status Code: 404

				
					{
    "message": "Not Found!"
}

				
			

HTTP Status Code: 500

				
					{
    "message": "Server Error"
}

				
			

Faks Detayı

Bir faks’ın detay bilgilerini görmek için kullanılan metottur.

http://yenifaks.telsam.com.tr/api/v1/fax/{id}

(HTTP METHOD: POST)

Path Parameters

id: Faks listesi yanıtında gelen id değeri

Örnek Başarılı Yanıt

HTTP Status Code: 200

				
					{
    "fax": {
        "id": 272825,
        "phone": "90XXXXXXXXXX",
        "subject": null,
        "call_type": "incoming",
        "status": "failed",
        "again": 2,
        "did": "908502590260",
        "created_at": null
    },
    "detail": [
        {
            "id": 584337,
            "calldate": "2021-12-03 11:13:46",
            "subject": null,
            "src": "90XXXXXXXXXX",
            "dstnum": "908502590260",
            "disposition": "ANSWERED",
            "calltype": "incoming",
            "status": "FAILED"
        },
        {
            "id": 584338,
            "calldate": "2021-12-03 11:14:20",
            "subject": null,
            "src": "90XXXXXXXXXX",
            "dstnum": "908502590260",
            "disposition": "ANSWERED",
            "calltype": "incoming",
            "status": "FAILED"
        }
    ]
}

				
			
Örnek Hatalı Yanıt

HTTP Status Code: 401

				
					{
    "message": "Unauthenticated."
}

				
			

HTTP Status Code: 403

				
					{
    "message": "This action is unauthorized."
}

				
			

HTTP Status Code: 404

				
					{
    "message": "Not Found!"
}

				
			

HTTP Status Code: 500

				
					{
    "message": "Server Error"
}

				
			

Faks dosyası indirme

Faks gönderilen verinin pdf dosyasını indirmek için kullanılan metottur.

 http://iys.telsa.com.tr/api/v1/fax/download/{id}

(HTTP METHOD: POST)

Path Parameters

id: Faks listesi yanıtında gelen id değeri

Örnek Başarılı Yanıt

HTTP Status Code: 200

Örnek Hatalı Yanıt

HTTP Status Code: 401

				
					{
    "message": "Unauthenticated."
}

				
			

HTTP Status Code: 403

				
					{
    "message": "This action is unauthorized."
}

				
			

HTTP Status Code: 404

				
					{
    "message": "Not Found!"
}

				
			

HTTP Status Code: 500

				
					{
    "message": "Server Error"
}

				
			

Faks Gönderme

Faks göndermek için kullanılan metottur.

http://yenifaks.telsam.com.tr/api/v1/fax

(HTTP METHOD: POST)

Request Body Schema

did: Gönderim yapmak istediğiniz numaranız
phones: [Array] Gönderim yapmak istediğiniz numaralar
files: [Array] Faks olarak göndermek istediğiniz jpeg,png,bmp,docx,doc,xls,xlsx,pdf,tiff uzantılarından birisine sahip dosyalarınızın base64 encode yapılmış karşılığı.

Örnek İstek
				
					{
    "did":"908502590260",
    "phones":["908502590260"],
    "files":[
        "file base64 encode here"
    ]
}
				
			
Örnek Başarılı Yanıt

HTTP Status Code: 200

				
					{
    "process": true,
    "faxes": [
        {
            "id": 278563,
            "phone": "908502590260",
            "subject": null,
            "call_type": "outgoing",
            "status": "pending",
            "again": null,
            "did": "908502590260",
            "created_at": "2021-12-23 15:39:26"
        }
    ]
}

				
			
Örnek Hatalı Yanıt

HTTP Status Code: 401

				
					{
    "message": "Unauthenticated."
}

				
			

HTTP Status Code: 403

				
					{
    "message": "This action is unauthorized."
}

				
			

HTTP Status Code: 404

				
					{
    "message": "Not Found!"
}

				
			

HTTP Status Code: 422

				
					{
    "message": "The given data was invalid.",
    "errors": {
        "did": [
            "did değeri geçersiz."
        ]
    }
}
				
			

HTTP Status Code: 500

				
					{
    "message": "Server Error"
}