Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook Graph API Error 400 #1776

Open
chunky1405 opened this issue Sep 27, 2023 · 0 comments
Open

Facebook Graph API Error 400 #1776

chunky1405 opened this issue Sep 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@chunky1405
Copy link

I have problems to this code:

const axios = require('axios')

/**

  • Get Facebook details
  • @title Get Facebook details
  • @category
  • @author
    */
    const myAction = async () => {
    try {
    var headers = {
    'Content-Type': 'application/json'
    }
    var endpoint =
    'https://graph.facebook.com/' +
    event.target +
    '?fields=name,first_name,last_name&access_token=' +
    session.fb_access_token
    var response = await axios.get(endpoint, { headers: headers })
    // store to user object
    user['full_name'] = response.data.name
    session.full_name = response.data.name
    user['first_name'] = response.data.first_name
    user['last_name'] = response.data.first_name
    bp.logger.debug(JSON.stringify(response.data))
    } catch (err) {
    bp.logger.warn(err)
    }
    }

return myAction()

But I got Error 400 on my end. Can you help me to hinder on this one? Thanks.

@chunky1405 chunky1405 added the bug Something isn't working label Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant