Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Bulutfon.Api/Bulutfon.Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
<Compile Include="Models\Post\ResponseSendMessage.cs" />
<Compile Include="Models\Recipient.cs" />
<Compile Include="Models\ResponseObjects\AnnouncementsResponse.cs" />
<Compile Include="Models\ResponseObjects\AutomaticCallListResponse.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Models\ResponseObjects\AutomaticCallResponse.cs" />
<Compile Include="Models\ResponseObjects\CdrResponse.cs" />
<Compile Include="Models\ResponseObjects\CdrsResponse.cs" />
Expand Down
19 changes: 16 additions & 3 deletions Bulutfon.Api/BulutfonApi.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
Expand Down Expand Up @@ -122,7 +123,8 @@ public static TResponse PostObject<TPostObject, TResponse>(string uri, Token tok
if (ret == null || ret.Length == 0) {
return null;
}
return JsonConvert.DeserializeObject<TResponse>(Encoding.UTF8.GetString(ret), SerializerSettings());
var resString = Encoding.UTF8.GetString(ret);
return JsonConvert.DeserializeObject<TResponse>(resString, SerializerSettings());
}
}
catch (Exception e) {
Expand Down Expand Up @@ -265,8 +267,19 @@ public static byte[] GetStream(string uri, Token token, string key = "") {
/// </summary>
/// <param name="token">Token provider (access ve refresh token)</param>
/// <returns>Otomatik aramalar</returns>
public static AutomaticCall GetAutomaticCall(Token token) {
return GetObject<AutomaticCallResponse>("automatic-calls", token).automatic_call;
public static List<AutomaticCall> GetAutomaticCalls(Token token) {
return GetObject<AutomaticCallListResponse>("automatic-calls", token).automatic_calls;
}

/// <summary>
/// Id si verilen otomatik aramayı getir
/// </summary>
/// <param name="token">Token provider (access ve refresh token)</param>
/// <param name="id">Automatic Call Id</param>
/// <returns>Otomatik aramalar</returns>
public static AutomaticCall GetAutomaticCall(Token token,string id)
{
return GetObject<AutomaticCallResponse>("automatic-calls", token,id).automatic_call;
}

public static ResponseAutomaticCall CreateAutomaticCall(Token token, AutomaticCallCreator automaticCall) {
Expand Down
2 changes: 1 addition & 1 deletion Bulutfon.Api/Models/Recipient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public class Recipient
/// <summary>
/// Aranan kişi bir tuşa bastıysa basılan tuş
/// </summary>
public int gather { get; set; }
public int? gather { get; set; }
}
}
13 changes: 13 additions & 0 deletions Bulutfon.Api/Models/ResponseObjects/AutomaticCallListResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Collections.Generic;

namespace Bulutfon.Sdk.Models.ResponseObjects
{
/// <summary>
/// Otomatik aramalar
/// GET /automatic-calls.json
/// </summary>
public class AutomaticCallListResponse
{
public List<AutomaticCall> automatic_calls { get; set; }
}
}