I started following this github tutorial It successfully GET
all entries and POST
data to a form.
So after that as I move forward I wanted to add search filters with my GET call. After a lot of researching and trying different approaches I get to the point that I always get
{
status: 401,
response: "Permission denied"
}
as my JSON response. Following this I implemented search but it didn't work: https://www.stevenhenty.com/gravity-forms-api/#filter_entries
By consulting some php people they told me it's permission issue your call is correct. So I went here and tried both methods WordPress Cookie Authentication and External Clients: Signature Authentication but the response is the same.
I'm using the Cookie NSString *string = [NSString stringWithFormat:@"%@%@?_gf_json_nonce=%@",BaseURLString,route,[[NSUUID UUID] UUIDString]];
The _gf_json_nonce
after searching I got that it'll be the UDID of the phone so that is why I'm using that.
If I use the other signature one I use it as NSString *string = [NSString stringWithFormat:@"%@%@?api_key=%@&signature=%@&expires=%@",BaseURLString,route,api_key,signature,expires];
the result is the same.
So if I want to use any of this call with search filters I'm doing this
NSDictionary *params = @{@"key": @"2",
@"value": @"my@email.com",
@"operator": @"contains"};
NSMutableDictionary *modify = [NSMutableDictionary new];
[modify setObject:params forKey:@"field_filters"];
[manager GET:stringURL parameters:modify progress:nil success:^(NSURLSessionTask *task, id responseObject) {
So any ideas how to get it authenticate so that the call can start working.
UPDATE
1: I have also tried this but it didn't work. I've also commented on it.