shareCardWithPerson [Invalid type: expected NUMBER. (Expected non-null value)]

NateBI
Contributor

POSTMAN:
ACCESS_TOKEN obtained:
POST: https://api.domo.com/oauth/token data = {
"grant_type": "client_credentials",
"scope": "data" # "data dashboard workflow user"
}, auth = {CLIENT_ID,CLIENT_SECRET}
CodeEngine Called:
POST: url: https://company.domo.com/api/codeengine/v2/packages/35233147-8c17-420d-8f48-2754ae6108ea/versions/3.0.1/functions/shareCardWithPerson headers = {
"X-DOMO-Developer-Token": access_token,
"Content-Type": "application/json"
} body = {
"inputVariables": {
"person": 994139312,
"card_id": 908077640
},
"settings": { "getLogs": true
}
}
Error:
{
"status": 401,
"statusReason": "Unauthorized",
"path": "/api/codeengine/v2/packages/35233147-8c17-420d-8f48-2754ae6108ea/versions/3.0.1/functions/shareCardWithPerson",
"message": "Full authentication is required to access this resource",
"toe": "REDACTED"
}
I have used the sendEmail function just fine simply using the access_token generated from Domo admin. This token didn't work so I read I needed to generate one using the method explained above, however this also hasn't worked.
Tagged:
0
Best Answer
-
[MAD LAUGHING] It was the cardId variable incorrectly spelt.
1
Answers
-
Watched this:
https://www.youtube.com/watch?v=Qy0aXeJWSlI
Testing with original access key but in the headers not bearer token.
new error message:{
"status": 400,
"statusReason": "Bad Request",
"message": "The following input values are invalid: [Invalid type: expected NUMBER. (Expected non-null value)]",
"toe": "1RG8QZY4X2-12V69-681TW"real values removed but this is the body:
{
"inputVariables": {
"person": 000000,
"card_id": 0000000
},
"settings": { "getLogs": true
}
}I've also tried a list input for person and a string input for card_id based on error message.
Original js function:
/**
* Shares a card with a specific person
*
* @param {Person} person - The person
* @param {text} cardId - The ID of the card
* @returns {boolean}
*/
function shareCardWithPerson(person, cardId) {
return shareResource('badge', cardId, 'user', person);
}0 -
[MAD LAUGHING] It was the cardId variable incorrectly spelt.
1
Categories
- All Categories
- Product Ideas
- 2.1K Ideas Exchange
- Connect
- 1.3K Connectors
- 309 Workbench
- 7 Cloud Amplifier
- 10 Federated
- Transform
- 663 Datasets
- 119 SQL DataFlows
- 2.3K Magic ETL
- 823 Beast Mode
- Visualize
- 2.6K Charting
- 86 App Studio
- 46 Variables
- Automate
- 193 Apps
- 483 APIs & Domo Developer
- 87 Workflows
- 23 Code Engine
- AI and Machine Learning
- 23 AI Chat
- 4 AI Projects and Models
- 18 Jupyter Workspaces
- Distribute
- 117 Domo Everywhere
- 283 Scheduled Reports
- 11 Software Integrations
- Manage
- 143 Governance & Security
- 11 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 116 Community Announcements
- 5K Archive