Edits history of script submission #20935 for ' Get information for multiple user IDs (terra)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    /**
     * Get information for multiple user IDs
     * Used to query for information for multiple Terra User IDs
     */
    export async function main(auth: RT.Terra, body: Body) {
    	const url = new URL(`https://api.tryterra.co/v2/bulkUserInfo`)
    
    	const response = await fetch(url, {
    		method: 'POST',
    		headers: {
    			'dev-id': auth.devId,
    			'Content-Type': 'application/json',
    			'X-api-key': auth.apiKey
    		},
    		body: JSON.stringify(body)
    	})
    	if (!response.ok) {
    		const text = await response.text()
    		throw new Error(`${response.status} ${text}`)
    	}
    	return await response.json()
    }
    
    /* eslint-disable */
    /**
     * This file was automatically generated by json-schema-to-typescript.
     * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
     * and run json-schema-to-typescript to regenerate this file.
     */
    
    /**
     * List of user IDs to get information for
     */
    export type Body = string[]
    

    Submitted by hugo697 235 days ago