Invalid key on updating card

while updating a card by following documentation i am having error of 401 Invalid Key … on th other hand the key works find in creating and deleting cards and other operations. did anyone face that issue or someone can help me ?

the query is

$headers = array('Accept' => 'application/json');
$query = array(
    'name' => 'New--Card',
    'desc' => 'New--Card',
    'key' => 
    'token' => 
);

$response = Unirest\Request::put('https://api.trello.com/1/cards/6255187edf1c6b2c8a650b66/', $headers, $query);

The response is

Unirest\Response Object
(
    [code] => 401
    [raw_body] => invalid key
    [body] => invalid key
    [headers] => Array
        (
            [0] => HTTP/2 401
            [x-dns-prefetch-control] => off
            [x-frame-options] => DENY
            [x-download-options] => noopen
            [x-permitted-cross-domain-policies] => none
            [referrer-policy] => strict-origin-when-cross-origin
            [surrogate-control] => no-store
            [cache-control] => no-store, no-cache, must-revalidate, proxy-revalidate
            [pragma] => no-cache
            [expires] => 0
            [x-trello-version] => 1.124734.0
            [x-trello-environment] => Production
            [access-control-allow-origin] => *
            [access-control-allow-methods] => GET, PUT, POST, DELETE
            [access-control-allow-headers] => Authorization, Accept, Content-Type
            [access-control-expose-headers] => x-rate-limit-api-key-interval-ms, x-rate-limit-api-key-max, x-rate-limit-api-key-remaining, x-rate-limit-api-token-interval-ms, x-rate-limit-api-token-max, x-rate-limit-api-token-remaining
            [content-type] => text/plain; charset=utf-8
            [content-length] => 11
            [date] => Tue, 12 Apr 2022 07:14:53 GMT
            [x-envoy-upstream-service-time] => 246
            [expect-ct] => report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/trello-edge", max-age=86400
            [strict-transport-security] => max-age=63072000; preload
            [x-content-type-options] => nosniff
            [x-xss-protection] => 1; mode=block
            [atl-traceid] => 3d0ece430f2f141b
            [report-to] => {"group": "endpoint-1", "max_age": 600, "endpoints": [{"url": "https://dj9s4kmieytgz.cloudfront.net"}], "include_subdomains": true}
            [nel] => {"report_to": "endpoint-1", "max_age": 600, "include_subdomains": true, "failure_fraction": 0.001}
            [server] => globaledge-envoy
        )

)

Hello @MuhammadAsad

Are you sure it’s not just a proof-reading error? In the request URL, there’s a forward slash at the end, after the card’s key, that shouldn’t be there.