Skip to content

Current vk.com API version is deprecated, all requests are failing #108

@ARtoriouSs

Description

@ARtoriouSs

vk.com API returns an error during callback because current API version in request (v5.8) is deprecated since 1st June 2020

Reproduction

Try authenticating with /auth/vk, after redirect to callback it fails with the fallowing error:

(FunctionClauseError) no function clause matching in List.first/1

This happens because of current version deprecation, see the users.get API response:

%{      
  "error" => %{
    "error_code" => 8,
    "error_msg" => "Invalid request: versions below 5.21 are deprecated. Version param should be passed as \"v\". \"version\" param is invalid and not supported. For more information go to https://vk.com/dev/constant_version_updates",
    "request_params" => [
      %{
        "key" => "fields",
        "value" => "first_name,last_name,bdate,education,universities,domain,photo_400,photo_100"
      },
      %{"key" => "user_ids", "value" => "138555414"},
      %{"key" => "v", "value" => "5.8"},
      %{"key" => "method", "value" => "users.get"},
      %{"key" => "oauth", "value" => "1"}
    ]
  }
}

Fix

Updating to a newer version solves the problem, according to this doc the latest version is 5.124. According to changelog there are no critical changes to users.get, so I think the version can be safely updated. See #109

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions