class CorporateInformationController { @AuraEnabled (cacheable=true) public static Map<String, Object> wireSimpleOrComplexData(String accountId) { Map<String, Object> result = new Map<String, Object>(); Account acc = [SELECT Id, Name, AccountNumber FROM Account WHERE Id =: accountId LIMIT 1]; result.put('accountFromServer', acc); return result; } @AuraEnabled public static Map<String, Object> searchCorporateNumber(String accountId){ try { String accountname = [SELECT Name FROM Account WHERE Id =: accountId].Name; HttpRequest req = new HttpRequest(); String searchKey = EncodingUtil.urlEncode(accountName, 'UTF-8'); req.setEndpoint('https://info.gbiz.go.jp/hojin/v1/hojin?name=' + searchKey + '&page=1&limit=50'); req.setMethod('GET'); req.setHeader('Accept','application/json'); req.setHeader('X-hojinInfo-api-token','利⽤申請して取得したAPIキー'); Http http = new Http(); HTTPResponse res = http.send(req); Map<String, Object> mapJson = (Map<String, Object>)JSON.deserializeUntyped(res.getBody()); return mapJson; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } } @AuraEnabled public static Account updateAccount(Account account) { update account; return account; } }