Introduce Smartsheet-Integration-Source request header#121
Introduce Smartsheet-Integration-Source request header#121ahmed-ahmed-smartsheet wants to merge 7 commits intosmartsheet:mainlinefrom
Conversation
|
Can you update the description with some more information about what the Smartsheet-Integration-Source header is and what it is used for? It is something that is supported by all of the public api endpoints? |
|
@mattmeyerink I updated the description, let me know if you need further information or clarification |
|
@ahmed-ahmed-smartsheet I think I'm still not super clear about the purpose of this header. It is an optional attribute that clients are not required to send, so we won't be able to get reliable tracking from it. There is nothing stopping an "AI Integration" from not passing this header or passing an unexpected value which defeats the purpose of adding the header in the first place. |
|
@mattmeyerink Made the header mandatory, please review and let me know what you think |
| describe('Valid Headers', function() { | ||
| it('should accept valid AI integration source', function() { | ||
| (function() { | ||
| createClient({ | ||
| accessToken: 'test-token', | ||
| baseUrl: 'https://api.test.smartsheet.com/2.0/', | ||
| smartsheetIntegrationSource: 'AI,MyOrg,MyGPT' | ||
| }); | ||
| }).should.not.throw(); | ||
| }); | ||
|
|
||
| it('should accept valid SCRIPT integration source', function() { | ||
| (function() { | ||
| createClient({ | ||
| accessToken: 'test-token', | ||
| baseUrl: 'https://api.test.smartsheet.com/2.0/', | ||
| smartsheetIntegrationSource: 'SCRIPT,MyOrg,MyGPT' | ||
| }); | ||
| }).should.not.throw(); | ||
| }); | ||
|
|
||
| it('should accept valid APPLICATION integration source', function() { | ||
| (function() { | ||
| createClient({ | ||
| accessToken: 'test-token', | ||
| baseUrl: 'https://api.test.smartsheet.com/2.0/', | ||
| smartsheetIntegrationSource: 'APPLICATION,MyOrg,MyGPT' | ||
| }); | ||
| }).should.not.throw(); | ||
| }); | ||
|
|
||
| it('should accept valid PERSONAL_ACCOUNT integration source', function() { | ||
| (function() { | ||
| createClient({ | ||
| accessToken: 'test-token', |
There was a problem hiding this comment.
I'd use something like parametrized tests to dry up these tests in a single one:
const testCases = [
{ type: 'AI', description: 'AI integration source' },
{ type: 'SCRIPT', description: 'SCRIPT integration source' },
{ type: 'APPLICATION', description: 'APPLICATION integration source' },
{ type: 'PERSONAL_ACCOUNT', description: 'PERSONAL_ACCOUNT integration source' }
];| { | ||
| "name": "smartsheet", | ||
| "version": "4.5.0", | ||
| "version": "4.6.0", |
There was a problem hiding this comment.
| "version": "4.6.0", | |
| "version": "4.7.0", |
*** DO NOT MERGE ***
Added support for the Smartsheet-Integration-Source request header in httpRequestor.js. The header is used to distinguish between human-initiated API requests vs third-party initiated request such as AI connectors or IT Service Management. Smartsheet needs a way to breakdown Public API requests source in order to enhance services and innovate building new customer experiences with the uprising use of AI tools. AI connectors wishing to integrate with Smartsheet services can do so by providing the Smartsheet-Integration-Source header for their API calls.