hello,
I have this api it works fine, what i want is instead of static data i can pass variable but when i try to pass carrierid as variable in parameters it returns error.
when i pass variable it does not pass between json reponse
Please advice
string carrierid = "[\n\t\t\t\"se-314801\",\n\t\t\t\"se-314800\",\n\t\t\t\"se-314799\"\n\t\t]";
var client = new RestClient("https://api.shipengine.com/v1/rates");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("API-Key", "TEST_fNMcdeWurY4XH/Gc8gRntu3S95NewkLf2LVZcocrzi8");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n\t\"rate_options\": {\n\t\t\"carrier_ids\": '"+carrierid+"' ,\n\t\t\"service_codes\": [\n\t\t\t\"usps_priority_mail\",\n\t\t\t\"fedex_ground\",\n\t\t\t\"ups_ground\"\n\t\t]\n\t},\n\t\"shipment\": {\n\t\t\"ship_from\": {\n\t\t\t\"name\": \"John Doe\",\n\t\t\t\"address_line1\": \"4009 Marathon Blvd\",\n\t\t\t\"city_locality\": \"Austin\",\n\t\t\t\"state_province\": \"TX\",\n\t\t\t\"postal_code\": \"78756\",\n\t\t\t\"country_code\": \"US\",\n\t\t\t\"phone\": \"512-555-5555\"\n\t\t},\n\t\t\"ship_to\": {\n\t\t\t\"name\": \"Amanda Miller\",\n\t\t\t\"address_line1\": \"525 S Winchester Blvd\",\n\t\t\t\"city_locality\": \"San Jose\",\n\t\t\t\"state_province\": \"CA\",\n\t\t\t\"postal_code\": \"95128\",\n\t\t\t\"country_code\": \"US\"\n\t\t},\n\t\t\"packages\": [\n\t\t\t{\n\t\t\t\t\"weight\": {\n\t\t\t\t\t\"value\": 17,\n\t\t\t\t\t\"unit\": \"pound\"\n\t\t\t\t},\n\t\t\t\t\"dimensions\": {\n\t\t\t\t\t\"length\": 36,\n\t\t\t\t\t\"width\": 12,\n\t\t\t\t\t\"height\": 24,\n\t\t\t\t\t\"unit\": \"inch\"\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response.Write(response.Content);