0

I am working with CricAPI to get list of upcoming matches.

NSURL *url = [[NSURL alloc] initWithString:@"http://cricapi.com/api/matches/?apikey=Gxxxxxxxxxxxxxxxxxxxx2"];
NSMutableURLRequest *request = [[NSURLRequest alloc] initWithURL:url ];

AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
[manager GET:[url absoluteString]
  parameters:nil
     success:^(NSURLSessionDataTask *task, id JSON)

Its working fine, providing JSON output.

How can I get the score details of a particular match ? It says you have to provide "unique_id" of the match, I am not sure where to use it ?

S.S.D
  • 1,579
  • 2
  • 12
  • 23
  • Found out myself, just had to pass parameters: NSMutableURLRequest *request = [[NSURLRequest alloc] initWithURL:url ]; NSDictionary *para = @{@"unique_id":self.id2}; AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; manager.requestSerializer = [AFJSONRequestSerializer serializer]; [manager GET:[url absoluteString] parameters:para success:^(NSURLSessionDataTask *task, id JSON) – S.S.D Oct 06 '17 at 12:06

1 Answers1

0

You have to click on new match API or OLD match API from there you will get unique id of that match which you can use for your next query