Skip to content

Commit f278a21

Browse files
waleedlatif1claude
andcommitted
fix(agiloft): correct HTTP methods and parameter names per Agiloft API docs
- EWRemoveAttachment uses GET, not DELETE (revert incorrect change) - EWRetrieve uses `filePosition` parameter, not `position` - EWAttach uses PUT, not POST Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 522a702 commit f278a21

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/sim/app/api/tools/agiloft/attach/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export async function POST(request: NextRequest) {
8080
logger.info(`[${requestId}] Uploading file to Agiloft: ${resolvedFileName}`)
8181

8282
const agiloftResponse = await fetch(url, {
83-
method: 'POST',
83+
method: 'PUT',
8484
headers: {
8585
'Content-Type': userFile.type || 'application/octet-stream',
8686
Authorization: `Bearer ${token}`,

apps/sim/tools/agiloft/remove_attachment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const agiloftRemoveAttachmentTool: ToolConfig<
6767

6868
request: {
6969
url: 'https://placeholder.agiloft.com',
70-
method: 'DELETE',
70+
method: 'GET',
7171
headers: () => ({}),
7272
},
7373

@@ -76,7 +76,7 @@ export const agiloftRemoveAttachmentTool: ToolConfig<
7676
params,
7777
(base) => ({
7878
url: buildRemoveAttachmentUrl(base, params),
79-
method: 'DELETE',
79+
method: 'GET',
8080
}),
8181
async (response) => {
8282
const text = await response.text()

apps/sim/tools/agiloft/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export function buildRetrieveAttachmentUrl(
207207
const id = encodeURIComponent(params.recordId.trim())
208208
const field = encodeURIComponent(params.fieldName.trim())
209209
const position = encodeURIComponent(params.position)
210-
return `${base}/ewws/EWRetrieve?${buildEwBaseQuery(params)}&id=${id}&field=${field}&position=${position}`
210+
return `${base}/ewws/EWRetrieve?${buildEwBaseQuery(params)}&id=${id}&field=${field}&filePosition=${position}`
211211
}
212212

213213
export function buildRemoveAttachmentUrl(

0 commit comments

Comments
 (0)