@@ -52,38 +52,26 @@ export default class EnrichmentServiceInternalAPI
5252 ) : Promise < IOrganizationEnrichmentDataInternalAPI | null > {
5353 let response : IOrganizationEnrichmentDataInternalAPIResponse | undefined
5454
55- console . log (
56- '[DEBUG] Internal API URL:' ,
57- process . env [ 'CROWD_ORGANIZATION_ENRICHMENT_INTERNAL_API_URL' ] ,
58- )
59-
60- console . log (
61- '[DEBUG] Internal API Key:' ,
62- process . env [ 'CROWD_ORGANIZATION_ENRICHMENT_INTERNAL_API_KEY' ] ,
63- )
64-
65- console . log ( '[DEBUG] Input:' , {
66- name : input . displayName ,
67- urls : input . domains . map ( ( domain ) => cleanURL ( domain . value ) ) ,
68- } )
69-
7055 try {
71- const url = `${ process . env [ 'CROWD_ORGANIZATION_ENRICHMENT_INTERNAL_API_URL' ] } `
56+ const params = new URLSearchParams ( )
57+ params . append (
58+ 'message' ,
59+ JSON . stringify ( {
60+ name : input . displayName ,
61+ urls : input . domains . map ( ( domain ) => cleanURL ( domain . value ) ) ,
62+ } ) ,
63+ )
64+ params . append ( 'stream' , 'false' )
65+ params . append ( 'user_id' , 'cdp-organization-enrichment' )
66+
7267 const config = {
7368 method : 'post' ,
74- url,
69+ url : process . env [ 'CROWD_ORGANIZATION_ENRICHMENT_INTERNAL_API_URL' ] ,
7570 headers : {
7671 Authorization : `Bearer ${ process . env [ 'CROWD_ORGANIZATION_ENRICHMENT_INTERNAL_API_KEY' ] } ` ,
77- 'Content-Type' : 'application/json' ,
78- } ,
79- data : {
80- message : {
81- name : input . displayName ,
82- urls : input . domains . map ( ( domain ) => cleanURL ( domain . value ) ) ,
83- } ,
84- stream : false ,
85- user_id : 'cdp-organization-enrichment' ,
72+ 'Content-Type' : 'application/x-www-form-urlencoded' ,
8673 } ,
74+ data : params . toString ( ) ,
8775 validateStatus : function ( status : number ) {
8876 return ( status >= 200 && status < 300 ) || status === 404 || status === 422
8977 } ,
0 commit comments