Retrieve Mureka API account configuration for account

December 2, 2024 (December 30, 2024)

Table of contents

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

Setup Mureka

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

The account value should correspond to an account configured previously via a POST /accounts/account request.

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Responses
  • 200 OK

    {
        "updated": 1724514995,
        "account": "123456789",
        "token": "<token a>",
        "updatedUTC": "2024-10-24T15:56:35.000Z ",
        "tokenIssuedDaysAgo": 30
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
  • 404 Not Found

    Configuration not found. To create configuration use POST /accounts/account.

Model
{ // TypeScript, all fields are optional
  account: string
  token: string
  updated: number
  updatedUTC: string
  tokenIssuedDaysAgo: number
}
Examples
  • curl https://api.useapi.net/v1/mureka/accounts/<account> \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const account = "Previously configured account"; 
    const apiUrl = `https://api.useapi.net/v1/mureka/accounts/${account}`; 
    const response = await fetch(apiUrl, {
      headers: {
        "Authorization": `Bearer ${token}`,
      },
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    account = "Previously configured account"
    apiUrl = f"https://api.useapi.net/v1/mureka/accounts/{account}"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It