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

Error when accessing via https://api.8base.com/<WORKSPACE_ID>/webhook/contacts?type=all #2

Open
talgolan opened this issue Sep 17, 2019 · 8 comments
Assignees

Comments

@talgolan
Copy link
Contributor

{
"errors": [
{
"code": "EntityNotFoundError",
"message": "Webhook with path: '/ck0fxfr9o000201l4afeveqo9/webhook/contacts' and httpMethod: 'GET' is absent.",
"details": {
"webhook": "Webhook with path: '/ck0fxfr9o000201l4afeveqo9/webhook/contacts' and httpMethod: 'GET' is absent."
}
}
]
}

@sebscholl
Copy link
Contributor

Hey @talgolan - did you deploy the function to a workspace? Are you getting this response when running it locally, or in the browser?

@talgolan
Copy link
Contributor Author

Everything works perfectly via curl (command-line), but fails via a browser.

./contacts.sh all
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 534 100 451 100 83 576 106 --:--:-- --:--:-- --:--:-- 575
{
"data" : {
"contactsList" : {
"count" : 4,
"items" : [
{
"email" : "bob@example.co",
"firstName" : "Bob",
"id" : "ck0mlkaor00m001mc1x3gdu48",
"lastName" : "Smith"
},
{
"email" : "tom@example.co",
"firstName" : "Tom",
"id" : "ck0mlkawp00n901mce5vuguz9",
"lastName" : "Johnson"
},
{
"email" : "jenny@example.co",
"firstName" : "Jenny",
"id" : "ck0mlkb7000m301mcfzi55cbe",
"lastName" : "Jacobsen"
},
{
"email" : "kayla@example.co",
"firstName" : "Kayla",
"id" : "ck0mlkbhp02ii01lfbufu7vmf",
"lastName" : "Crawford"
}
]
}
}
}

@sebscholl
Copy link
Contributor

@talgolan can you send me the endpoint your calling in the browser?

@talgolan
Copy link
Contributor Author

@sebscholl
Copy link
Contributor

Hey @talgolan ! You need to deploy the custom function to your workspace. try running 8base deploy

Do you have the CLI installed?

npm install -g 8base-cli

8base login

@talgolan
Copy link
Contributor Author

Done.

What is your recommended approach for injecting the necessary "Auth" header into the HTTPS request?

@sebscholl
Copy link
Contributor

sebscholl commented Sep 19, 2019

Hey! So two ways.

  1. In the function, you can use the checkPermissions option when making the API call.
ctx.api.gqlRequest(QUERY, VARIABLES, { checkPermissions: false });
  1. You can go to roles and permissions and update the guest role to have access.
    https://www.youtube.com/watch?v=yE_tcaEsxfk
    and
    https://docs.8base.com/8base-console/roles-and-permissions#managing-permissions

Lmk which you like better :)

Sebastian

@talgolan
Copy link
Contributor Author

Both ways are great. You cats are building something very special!

https://api.8base.com/ck0fxfr9o000201l4afeveqo9/webhook/contacts?type=all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants