in reply to post JSON using HTTP::Tiny - cannot parse URL
Hi,
Try this with your real auth token:
(I get the following:)$ perl -Mstrict -MJSON -MData::Dumper -MHTTP::Tiny -E'my $resp = HTTP: +:Tiny->new->post("https://moneybird.com/api/v2/123/external_sales_inv +oices", { headers => {Accept => "application/json", "Content-Type" => + "application/json", Authorization => "Bearer 123"}, content => to_js +on({ external_sales_invoices => { "reference" => "M-8426", "date" => +"2020-03-14", "contact_id" => 456, "details_attributes" => [ { "descr +iption" => "coffee", "price" => 2.25, "tax_rate_id" => 891 } ] } })}) +; say Dumper $resp->{content}'
$VAR1 = '{"error":"access token invalid","symbolic":{"request":"invali +d_grant"}}';
Hope this helps!
|
|---|