电子合同API开发文档 v5

签署合同-自定义签署

请求地址:/v5/Contracts/signed.json

请求方式:POST

接口版本: 5.2.3

接口描述:

NSString *httpUrl = @"https://api-v2.1dq.com/v5/Contracts/signed.json";
NSString *httpArg = @"easy_id=175592531139104768&signed_data=[ {
        "seal_id": "必填-印章id",
	"page": "第几页如2",
	"x": "必填-需要盖章的x坐标位置",
        "y": "必填-需要盖章的y坐标位置"
    }
,{ "seal_id": "abf447a8-ad71-11ea-b95e-0242ac320a0c", "page": "1", "x": "200", "y": "200" }, { "seal_id": "abf447a8-ad71-11ea-b95e-0242ac320a0c", "page": "6", "x": "200", "y": "200" }]&words_id=2c6084c0-ad71-11ea-9664-0242ac320a0c&certification_code=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9&certification_type=mobile&cross_page_data=[ { "seal_id": "abf447a8-ad71-11ea-b95e-0242ac320a0c", "y": "100" },{
        "seal_id": "必填-印章id",
        "y": "必填-需要盖章的y坐标位置"
    } ]&page_width=800";
[self request: httpUrl withHttpArg: httpArg];

-(void)request: (NSString*)httpUrl withHttpArg: (NSString*)HttpArg  {
    NSString *urlStr = [[NSString alloc]initWithFormat: @"%@?%@", httpUrl, HttpArg];
    NSURL *url = [NSURL URLWithString: urlStr];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL: url cachePolicy: NSURLRequestUseProtocolCachePolicy timeoutInterval: 10];
    [request setHTTPMethod: @"GET"];
    [NSURLConnection sendAsynchronousRequest: request
        queue: [NSOperationQueue mainQueue]
        completionHandler: ^(NSURLResponse *response, NSData *data, NSError *error){
            if (error) {
                NSLog(@"Httperror: %@%ld", error.localizedDescription, error.code);
            } else {
                NSInteger responseCode = [(NSHTTPURLResponse *)response statusCode];
                NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                NSLog(@"HttpResponseCode:%ld", responseCode);
                NSLog(@"HttpResponseBody %@",responseString);
            }
        }];
}