English
English
简体中文
Register
Log In
English
English
简体中文
Register
Log In
Language
English
English
简体中文
Register
Log In

How to obtain the parameter apiName in the general interface?

Last Updated on2025-02-28 07:17:26
1. After initializing the interface by calling SDK, set setDebugMode: YES.
#ifdef DEBUG
[[ThingSmartSDK sharedInstance] setDebugMode:YES];
#else
#endif
2. When calling the SDK interface, the log will print as follows:
[ThingRequest] request: domain = 121.5.96.158, url = https://121.5.96.158/api.json, api = s.m.miniprogram.basic.get,
commonParams = {
"v" : "1.0",
}, businessParams = {
"xx1" : "value1",
"xx2" : "value2"
}
Here, api = s.m.miniprogram.basic.get is the required apiName.
"v" is: the version of this interface.
The content in businessParams is: the parameters required for this interface. If not, no parameters need to be passed.
3. Example:
NSDictionary * postData = @{
@"xx1" : @"value1",
@"xx2" : @"value2",
};
[[ThingSmartRequest new] requestWithApiName:@"s.m.miniprogram.basic.get" postData:postData version:@"1.0" success:^(id result) { NSLog(@"result: %@",result);
} failure:^(NSError *error) { NSLog(@"Failure: %@",error); }];
4. Similarly, when operating the business package SDK, there will be similar logs for the interface call as above. The corresponding apiName can be obtained and combined with the general interface to obtain detailed data.

Click for services and help

Help Center