• Resolved mennovink

    (@mennovink)


    I’m trying to use the rest api provided by licence manager but for some reason i am unable to get it to work.

    To test this i am invoking:
    curl -X GET -i "https://domain.com/wp-json/lmfwc/v2/licenses/validate/SOME-KEY?consumer_key=ck_**&consumer_secret=cs_**"
    I am getting a 403 response:
    {"code":"lmfwc_rest_cannot_view","message":"Sorry, you cannot view this resource.","data":{"status":403}}

    I am getting the same issue when i translate the path to:
    https://domain.com/index.php?rest_route=/lmfwc/v2/licenses/validate/SOME-KEY

    After searching around on the internet i’ve found that CGI/FastCGI could be a problem. My webhost uses this. The suggested solution i’ve found is to add these lines to the .htaccess:

    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    My .htaccess file already contains these. They are being generated when i choose a custom permalink structure.

    I did verify that the restapi / routing / https work. If i call
    curl -X GET -i "https://domain.com/wp-json/wc/v2/products/attributes?consumer_key=ck_**&consumer_secret=cs_**"
    i am getting a http 200 response.

    I have already tried disabling plugins, but that didn’t help. Any idea what could be the problem or something else i can try?

Viewing 3 replies - 1 through 3 (of 3 total)
  • @mennovink Hi,

    Hope you are doing good.

    You are not providing the right permission while creating the rest API. please give read and write permissions, then test it.

    Thanks

    Thread Starter mennovink

    (@mennovink)

    The api key was already read/write so that was fine. But thanks for directing me towards permissions. I had made a seperate user to execute these requests from. I had given that user the role ‘Shop Manager’, that didn’t work. Now i’ve made that user administrator and then it works.

    @mennovink Great, thanks for the update.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘lmfwc_rest_cannot_view’ is closed to new replies.