In my iPhone app I am trying to see on sign up if the entered phone number is already attached to a current user within the app.
I can verify that my textfield entry is identical to a user's phone number within the app, however the following function always returns an error:
QBRequest.usersWithPhoneNumbers([self.mobileNumberTextField.text!], successBlock: { (response: QBResponse, page: QBGeneralResponsePage?, user: [QBUUser]?) in
print("user")
}, errorBlock: { (response: QBResponse) in
print("no user")
})
Below is the error output:
error: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: forbidden (403)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x138057340> { URL: http://apixxxxxxxxxxx.quickblox.com/users.json?filter%5B%5D=string%20phone%20in%20306xxxxxxx } { status code: 403, headers {
"Access-Control-Allow-Origin" = "*";
"Cache-Control" = "no-cache";
Connection = "keep-alive";
"Content-Type" = "application/json; charset=utf-8";
Date = "Sat, 07 May 2016 03:22:31 GMT";
"QB-Token-ExpirationDate" = "2016-05-07 05:22:29 UTC";
"QuickBlox-REST-API-Version" = "0.1.1";
Server = "nginx/1.8.1";
Status = "403 Forbidden";
"Transfer-Encoding" = Identity;
"X-Rack-Cache" = miss;
"X-Request-Id" = 331b0f8f7a18f5aff16fea6f13cedffc;
"X-Runtime" = "0.018348";
"X-UA-Compatible" = "IE=Edge,chrome=1";
} }, NSErrorFailingURLKey=http://apixxxxxx.quickblox.com/users.json?filter[]=string%20phone%20in%20306xxxxxx, com.alamofire.serialization.response.error.data=<7b226572 726f7273 223a7b22 62617365 223a5b22 55736572 73207265 74726965 76696e67 20666f72 62696464 656e2069 6e206164 6d696e20 70616e65 6c2c2061 70706c69 63617469 6f6e2073 65747469 6e67732e 20536574 75702069 74206865 72652068 74747073 3a2f2f61 646d696e 71622d63 68617474 65722e71 7569636b 626c6f78 2e636f6d 2f617070 732f3332 3936382f 73657474 696e6773 225d7d7d>, NSLocalizedDescription=Request failed: forbidden (403)}
Looks like you have similar issue. Please refer to this link.