Retrive data by using cloud APIs


I have set of Estimote beacons and I want to list them using Estimote clound APIs.I am using

It works well in the terminal.
However, in the ios app, it is returning ----“Payment Required”.

The code is following:

#define API_USERNAME      @"xxxxxxx"
#define API_PASSWORD      @"xxxxxxx"

    NSURL *url = [NSURL URLWithString: [NSString stringWithFormat:@"", API_USERNAME, API_PASSWORD]];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
    [request setURL:url];
    [request setHTTPMethod:@"GET"];
    [request setValue:@"Accept: application/json" forHTTPHeaderField:@"Content-Type"];
    NSError *error;
    NSURLResponse *response;
    NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
    NSString *ret = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    NSLog(@"ret=%@", ret);

Thanks for helping.


Email us at, and we’ll look into it.

Hey guys :slight_smile:

is there any update on this issue?
I’m having the exact same problem here (only that I’m working with Swift rather than Objective-C). The Curl command works fine in the terminal, but my iOS App only receives a 402 (payment required).

This is my code:

guard let url = URL(string: "") else {return}
    var request = URLRequest(url: url)
    request.httpMethod = "GET"

    // set up the session
    let config = URLSessionConfiguration.default
    let session = URLSession(configuration: config)
    // make the request
    let task = session.dataTask(with: request) {
        (data, response, error) in
        // check for any errors
        guard error == nil else {
        print("Response code: ", response) //--> gives 402 Error

Any hints are welcoome! Thanks a lot!