Hi,
I need to destroy a friend (unfollow) so this is my code:
let client = TWTRAPIClient()
var clientError : NSError?
let statusesShowEndpoint = "https://api.twitter.com/1.1/friendships/destroy.json"
let params = ["user_id":"1401881"]
let request = client.URLRequestWithMethod("DELETE", URL: statusesShowEndpoint, parameters: params, error: &clientError)
client.sendTwitterRequest(request) { (response, data, connectionError) -> Void in
if connectionError != nil {
print("Error: \(connectionError)")
}
guard let myData = data else {
print("error nil")
return
}
let json = JSON(data: myData)
print(json)
}
I got this error:
"Request failed: forbidden (403)" UserInfo={NSLocalizedFailureReason=Twitter API error : Your credentials do not allow access to this resource. (code 220), TWTRNetworkingStatusCode=403, NSErrorFailingURLKey=https://api.twitter.com/1.1/friendships/destroy.json?user_id
Is this related to API keys? I tried to change them with read/write but still not working!
Any suggestions?
Thanks.