The gist of this treaty is that:
Under Article 36 of the Vienna Convention on Consular Relations, 1963 (VCCR), local authorities must notify all detained foreigners “without delay” of their right to have their consulate informed of their detention. At the request of the national, the authorities must then notify the consulate without delay, facilitate unfettered consular communication and grant consular access to the detainee. Consuls are empowered to arrange for their nationals’ legal representation and to provide a wide range of humanitarian and other assistance, with the consent of the detainee. Local laws and regulations must give “full effect” to the rights enshrined in Article 36. The USA ratified the VCCR without reservations in 1969; so fundamental is the right to consular notification and access that the US Department of State considers it to be required under customary international law in all cases, even if the detainee’s home country has not signed the VCCR. As of 1 January 2000, at least 167 countries were parties to the VCCR.
More information can be had from here: http://www.internationaljusticeproject.org/nationalsInstruments.cfm
A copy of the treaty can be downloaded from the UN: The Vienna Convention on Consular Relations