# Testing SMS Pumping Risk with Magic Numbers

> \[!WARNING]
>
> Please review the [Magic Numbers for Lookup](/docs/lookup/magic-numbers-for-lookup) and use your testing credentials for the correct Region when testing phone numbers. If you use your production credentials then the phone numbers don't display the correct responses shown below.
>
> Note: Your testing credentials are region specific so make sure you have selected the region you want to test in the top right corner of the [Auth Tokens page of your Console](https://console.twilio.com/us1/account/keys-credentials/api-keys?frameUrl=%2Fconsole%2Fproject%2Fapi-keys%3Fx-target-region%3Dus1) before testing phone numbers.

## SMS Pumping Risk Magic Numbers

These phone numbers have simulated information for the following inputs which is for testing the [SMS Pumping Risk](/docs/lookup/v2-api/sms-pumping-risk) feature. Testing SMS Pumping Risk Score with Magic Numbers works just like SMS Pumping Risk in production, and only requires you to submit the phone number with your query.

*Note: These phone numbers are examples only and do not include real time data.*

### Below are the Phone Numbers for SMS Pumping Risk Score, along with their Inputs/Outputs:

These phone number examples show different types of SMS Pumping Risk Scores.

| Phone Number  | CarrierRiskCategory | NumberBlocked | NumberBlockedDate      | NumberBlockedLast3Months | SMSPumpingRiskScore |
| ------------- | ------------------- | ------------- | ---------------------- | ------------------------ | ------------------- |
| +441234567890 | high                | false         | "2023-07-20T17:10:17Z" | true                     | 2                   |
| +911234567890 | low                 | false         | null                   | null                     | 2                   |
| +621234567890 | high                | false         | "2023-07-12T17:03:13Z" | true                     | 44                  |
| +921234567890 | high                | false         | null                   | null                     | 40                  |
| +441234567891 | high                | true          | "2023-09-06T03:44:21Z" | true                     | 34                  |
| +911234567891 | high                | true          | "2023-09-05T01:23:57Z" | true                     | 36                  |
| +621234567891 | high                | true          | "2023-09-06T17:06:32Z" | true                     | 44                  |
| +921234567891 | high                | true          | "2023-09-05T17:10:13Z" | true                     | 34                  |

These phone number examples show different types errors when using SMS Pumping Risk.

| Phone Number  | Error Code                      |
| ------------- | ------------------------------- |
| +441234567892 | [60003](/docs/api/errors/60003) |
| +441234567893 | [60600](/docs/api/errors/60600) |
| +441234567894 | [60601](/docs/api/errors/60601) |
| +441234567895 | [60606](/docs/api/errors/60606) |
| +441234567896 | [60608](/docs/api/errors/60608) |
| +441234567897 | [60613](/docs/api/errors/60613) |

SMS Pumping Risk Lookup

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchPhoneNumber() {
  const phoneNumber = await client.lookups.v2
    .phoneNumbers("+447772000001")
    .fetch({ fields: "sms_pumping_risk" });

  console.log(phoneNumber.smsPumpingRisk);
}

fetchPhoneNumber();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

phone_number = client.lookups.v2.phone_numbers("+447772000001").fetch(
    fields="sms_pumping_risk"
)

print(phone_number.sms_pumping_risk)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Lookups.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var phoneNumber = await PhoneNumberResource.FetchAsync(
            pathPhoneNumber: "+447772000001", fields: "sms_pumping_risk");

        Console.WriteLine(phoneNumber._SmsPumpingRisk);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.lookups.v2.PhoneNumber;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        PhoneNumber phoneNumber = PhoneNumber.fetcher("+447772000001").setFields("sms_pumping_risk").fetch();

        System.out.println(phoneNumber.getSmsPumpingRisk());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	lookups "github.com/twilio/twilio-go/rest/lookups/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &lookups.FetchPhoneNumberParams{}
	params.SetFields("sms_pumping_risk")

	resp, err := client.LookupsV2.FetchPhoneNumber("+447772000001",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.SmsPumpingRisk != (lookups.SmsPumpingRiskInfo{}) {
			fmt.Println(resp.SmsPumpingRisk)
		} else {
			fmt.Println(resp.SmsPumpingRisk)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$phone_number = $twilio->lookups->v2
    ->phoneNumbers("+447772000001")
    ->fetch(["fields" => "sms_pumping_risk"]);

print $phone_number->smsPumpingRisk;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

phone_number = @client
               .lookups
               .v2
               .phone_numbers('+447772000001')
               .fetch(fields: 'sms_pumping_risk')

puts phone_number.sms_pumping_risk
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:lookups:v2:phone-numbers:fetch \
   --phone-number +447772000001 \
   --fields sms_pumping_risk
```

```bash
curl -X GET "https://lookups.twilio.com/v2/PhoneNumbers/%2B447772000001?Fields=sms_pumping_risk" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "calling_country_code": "1",
  "country_code": "US",
  "phone_number": "+447772000001",
  "national_format": "(415) 992-9960",
  "valid": true,
  "validation_errors": [],
  "caller_name": null,
  "sim_swap": null,
  "call_forwarding": null,
  "line_status": null,
  "line_type_intelligence": null,
  "identity_match": null,
  "reassigned_number": null,
  "sms_pumping_risk": {
    "carrier_risk_category": "moderate",
    "number_blocked": false,
    "number_blocked_date": null,
    "number_blocked_last_3_months": null,
    "sms_pumping_risk_score": 61,
    "error_code": null
  },
  "phone_number_quality_score": null,
  "pre_fill": null,
  "url": "https://lookups.twilio.com/v2/PhoneNumbers/+14159929960"
}
```
