Skip to content

Commit

Permalink
Fixing redact api
Browse files Browse the repository at this point in the history
  • Loading branch information
slorello89 committed Oct 7, 2019
1 parent 8b16fe2 commit 39ed469
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Nexmo.Api/Client/Redact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public Redact(Credentials creds)
Credentials = creds;
}

public void RedactTransaction (RedactRequest redactRequest, Credentials creds = null)
public NexmoResponse RedactTransaction (RedactRequest redactRequest, Credentials creds = null)
{
Nexmo.Api.Redact.RedactTransaction(redactRequest, creds ?? Credentials);
return Nexmo.Api.Redact.RedactTransaction(redactRequest, creds ?? Credentials);
}
}
}
4 changes: 2 additions & 2 deletions Nexmo.Api/Redact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public RedactRequest(string id, string product, string type)
/// <param name="redactRequest"></param>
/// <param name="creds">(Optional) Overridden credentials for only this request</param>
/// <returns></returns>
public static void RedactTransaction(RedactRequest redactRequest, Credentials creds = null)
public static NexmoResponse RedactTransaction(RedactRequest redactRequest, Credentials creds = null)
{
ApiRequest.DoPostRequestWithContent(ApiRequest.GetBaseUriFor(typeof(Redact), "/v1/redact/transaction"), redactRequest, creds);
return VersionedApiRequest.DoRequest("POST",ApiRequest.GetBaseUriFor(typeof(Redact), "/v1/redact/transaction"), redactRequest, creds);
}
}
}
2 changes: 1 addition & 1 deletion Nexmo.Api/Request/VersionedApiRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static NexmoResponse DoRequest(string method, Uri uri, object payload, Cr

// do we need to use basic auth?
// TODO / HACK: this is a newer auth method that needs to be incorporated better in the future
if (uri.AbsolutePath.StartsWith("/accounts/") || uri.AbsolutePath.StartsWith("/v2/applications"))
if (uri.AbsolutePath.StartsWith("/accounts/") || uri.AbsolutePath.StartsWith("/v2/applications") || uri.AbsolutePath.StartsWith("/v1/redact/transaction"))
{
var authBytes = Encoding.UTF8.GetBytes(creds.ApiKey + ":" + creds.ApiSecret);
req.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic",
Expand Down

0 comments on commit 39ed469

Please sign in to comment.