# Box Image Storage

HelpYouSponsor’s default configuration enables you to store images for both donors and sponsorship entities. All uploaded files are automatically resized to 500px, which is ideal for online use and minimizes page load times. However, if you need larger files, we’ve integrated with Box.com to allow you to store full-size images alongside the 500px version in HelpYouSponsor.

### Box.com Setup

First, [create a box.com account](http://box.com/). It must be a paid account to use their ['direct link' functionality](https://support.box.com/hc/en-us/articles/200519908-Direct-Linking).

After verifying your Box.com account, go to [developers.box.com](http://developers.box.com/) and create a “Box Content App” on Box.com.

Click on “Get Started,” then select “Box Content,” and give your app a name (any name you like).

<figure><img src="https://3474867315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtvGkHqkxF65IiEXi3vz%2Fuploads%2FOvw9OC1vCAdVE5WwxknB%2FBox%20save.png?alt=media&#x26;token=a5149f80-46d3-46a8-9243-a5c0e05d54a2" alt=""><figcaption></figcaption></figure>

Click “**Create Application**” and then proceed by clicking on “Configure Application.”

You’ll then see the configuration page. Don’t worry about making any changes here!

Box.com might require you to input a **redirect\_url** parameter. The required redirect URL is:

***<https://app.helpyousponsor.com/admin/box\\_response>***

(If you have a custom HYS URL, adjust the beginning of the URL accordingly.)

Next, find the **client\_id** (also known as API key) and the **client\_secret** fields. Make sure to note them down, as you’ll need them later.

<figure><img src="https://3474867315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtvGkHqkxF65IiEXi3vz%2Fuploads%2FaGwr6hzvoD42Ci1o3Ywv%2Fclient_secret%20fields.png?alt=media&#x26;token=02b3bb02-e31c-4adc-941f-d41cb237e5da" alt=""><figcaption></figcaption></figure>

3\. The explanation is a  [bit technical](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing), but you’ll also need to contact Box.com support to set up CORS.

Once you have your client\_id (API key), write an email to <api@box.com>.

You’ll need two things:

* Your client\_id (API key)
* Your domain name

Your HelpYouSponsor domain will vary depending on your individual setup.

To find your domain, simply log in to your admin login and look at the address bar.

<figure><img src="https://content.gitbook.com/content/oKO2daI6MQ1KQOLltE3m/blobs/b7MNC8ip7S4uev8qu0aD/image_2023-05-24_145726115.png" alt=""><figcaption></figcaption></figure>

In this example our domain name is **"app.helpyousponsor.com"**

Your email should look similar to this:

> ***"We are using a box.com integrated application that needs CORS support enabled.***
>
> ***Our client\_id (API Key) is : (Insert your client\_id here)***
>
> ***Please enable CORS on our app for the following domains:***
>
> ***http\:// (insert your domain here)***
>
> ***https\:// (insert our domain here)***
>
> ***Thank You!"***

It may take a day or two for Box.com support to get back to you to let you know they have activated CORS for your domain.

Then, go to add a file. It will redirect you to box.com's login page, and ask for your to 'grant access' to HelpYouSponsor. Click "grant" and it will put you back on the dashboard.

If there is a redirect\_url\_mismatch error, make sure to login to HelpYouSponsor with HTTPS:// rather than HTTP://

Now, go to add a file again, and you will see an orange bordered drop-zone area where you can drag files.

### HelpYouSponsor Configuration

Now, you will need to login to your HelpYouSponsor admin account.

Click on "**Account Settings"** on the main menu under **Settings** and click on the **"Integrations"** tab.

Click on "**View integration**" on the "Box" card which will open up a drawer to fill in the required information.

<figure><img src="https://3594793218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoKO2daI6MQ1KQOLltE3m%2Fuploads%2FyOYz6EpEBaK7oLfA799i%2Fimage.png?alt=media&#x26;token=755ce0b4-5f3c-4e0f-a7d7-93bd18c78de6" alt="" width="375"><figcaption></figcaption></figure>

Here fill in the "**client\_secret"** from your box account in the "**Private key"** field **client\_id** in the "**Public key"** field and click "**Update**".
