How to send an object to API's

I’ll start by saying I am quite new to API’s so sorry if this is a stupid question. I have been using API’s for a few weeks and been quite successful, however I have come across an issue that i just cannot solve, but i guess it is pretty easy.

I am wanting to get a list of rates back from a shipping API, so obviously I have to give it some information, however some of this information has to be in an object and I have no idea how to pass an object in the API. Infact I cannot get the API to initialise in the plugin section as I dont know the format. Below is what I need to send to the API. This is the raw body text from POSTMAN

{
 "origin_address": {
      "line_1": "125 Any Street",
      "line_2": "Dalton",
      "state": "Newport",
      "city": "South Wales",
      "postal_code": "HD1 5RR",
      "country_alpha2": "GB",
      "company_name": "Company Name",
      "contact_name": "Contact Name",
      "contact_phone": "074014585635",
      "contact_email": "[email protected]"
 },
 "destination_address": {
      "line_1": "Sttutter Gart",
      "line_2": "Somewhere in DE",
      "state": "Somweher else in DE",
      "city": "Berlin",
      "postal_code": "123456",
      "country_alpha2": "DE",
      "company_name": "Company name",
      "contact_name": "Contact Name",
      "contact_phone": "003198989898",
      "contact_email": "[email protected]"
 },
 "incoterms": "DDU",
 "insurance": {
      "is_insured": true,
      "insured_amount": 150,
      "insured_currency": "GBP"
 },
 "courier_selection": {
      "apply_shipping_rules": true
 },
 "shipping_settings": {
      "units": {
           "weight": "kg",
           "dimension": "cm"
      }
 },
 "parcels": [
      {
           "box": {
                "length": 5,
                "width": 5,
                "height": 5
           },
           "items": [
                {
                     "quantity": 1,
                     "description": "clothes",
                     "category": "Fashion",
                     "hs_code": "12345",
                     "origin_country_alpha2": "GB",
                     "declared_currency": "GBP",
                     "declared_customs_value": 10
                },
                {
                     "quantity": 5,
                     "description": "more stuff",
                     "category": "Fashion",
                     "hs_code": "1234555",
                     "origin_country_alpha2": "GB",
                     "declared_currency": "GBP",
                     "declared_customs_value": 2
                }
           ],
           "total_actual_weight": 0.2
      }
 ]

}

I think it depends on how your API provider expecting the object? Like you can send it in the body if it is a POST call. Body type could be JSON, Raw, Form-Data.

You can also insert dynamic values. Body (JSON object, use <> for dynamic values).
Screenshot_1

Hi thanks for the info. yes that was part of the issue. So i just copied and pasted the body from POSTMAN into the body of the API and it worked.

Great. Good wishes to your project :dart: