Create or update Mureka API account configuration

December 2, 2024

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Model
  5. Examples
  6. Try It

See Setup Mureka for details.

https://api.useapi.net/v1/mureka/accounts/account

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Request Body
{
    "account": "Mureka account",
    "token": "Mureka token",
}
  • account and token are required. Please see Setup Mureka for details.

  • account value specified in the request body must match the account value specified in the URL path https://api.useapi.net/v1/mureka/accounts/account.

Responses
  • 201 Created

    {
        "updated": 1724514995,
        "account": "123456789",
        "token": "<token>",
        "updatedUTC": "2024-10-24T15:56:35.000Z "
    }
    
  • 400 Bad Request

    {
      "error": "<Error message>",
      "code": 400
    }
    
  • 401 Unauthorized

    {
      "error": "Wrong username/password combination.",
      "code": 401
    }
    
Model
{ // TypeScript, all fields are optional
  account: string
  token: string
  updated: number
  updatedUTC: string
  error: string
  code: number
}
Examples
  • curl -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -H "Authorization: Bearer …" \
         -X POST https://api.useapi.net/v1/mureka/accounts/<account> \
         -d '{"account": "…", "token": "…"}'
    
  • const account = "Mureka account";      
    const token = "Mureka token";      
    const apiUrl = `https://api.useapi.net/v1/mureka/accounts/${account}`; 
    const api_token = "API token";
    const data = { 
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${api_token}`,
        'Content-Type': 'application/json' }
    };
    data.body = JSON.stringify({ 
      account, token
    });
    const response = await fetch(apiUrl, data);
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    account = "Mureka account"
    token = "Mureka token"
    apiUrl = f"https://api.useapi.net/v1/mureka/accounts/{account}" 
    api_token = "API token"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {api_token}"
    }
    body = {
        "account": f"{account}",
        "token": f"{token}"
    }
    response = requests.post(apiUrl, headers=headers, json=body)
    print(response, response.json())
    
Try It